|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi I have a requirement where i have to append the prev month (e.g Feb
for current date ) to the file name before sending it for some other processing. if input file name is xyz.txt output for the today's run should be xyz_Feb.txt. i tried this code 1 curmth=`date +%m` 2 mth=(Dec Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec) 3 prevmth=${mth[$((curmth - 1))]} 4 echo $prevmth but its giving a syntax error at Line 2 : `(' unexpected. TIA. Regards, naren |
|
![]() |
| Outils de la discussion | |
|
|