Как сделать манипулирование именами файлов в нужном формате - PullRequest
0 голосов
/ 08 мая 2019

Я новичок в Unix. Может ли кто-нибудь помочь мне с требованием, когда у меня есть список файлов в каталоге, я хочу манипулировать именами файлов в требуемом формате, как указано ниже

< Filenames present in directory >
AAAL_555A_ORANGE_F190404_D190408.TXT.freshfruits_20190422-115617    
AAAL_555A_MANGO_F190404_D190408.TXT.freshfruits_20190422-120939    
AAAL_555B_APPLE_F190404_D190408.TXT.freshfruits_20190422-121449    
AAAL_555B_ORANGE_F190404_D190408.TXT.freshfruits_20190422-115617    
AAAL_555B_Orange_F190404_D190408.TXT.freshfruits_20180422-115617    

<After modification  >
If 2nd string 555A and 3rd string is  ORANGE  or  2nd string 555A and 3rd string is  Orange the filename should be BB_Orange_555a_date +'%Y%m%d'.txt    
If 2nd string 555B and 3rd string is  ORANGE  or  2nd string 555A and 3rd string is  Orange the filename should be BB_Orange_555b_date +'%Y%m%d'.txt    
If 2nd string 555B and 3rd string is  APPLE  or  2nd string 555A and 3rd string is  Apple the filename should be BB_Apple_555b_date +'%Y%m%d'.txt     
If 2nd string 555A and 3rd string is  MANGO  or  2nd string 555A and 3rd string is  Mango the filename should be BB_Mango_555a_date +'%Y%m%d'.txt    

Можеткто-нибудь, помогите мне с сценарием Shell

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...