![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| what is -u option in while loop in unix | krishna_gnv | Shell Programming and Scripting | 1 | 05-20-2008 03:08 AM |
| Unix Loop from a file | dkranes | Shell Programming and Scripting | 4 | 04-06-2007 04:36 PM |
| Unix-Sql Loop error | manu_byc | Shell Programming and Scripting | 3 | 02-05-2007 09:40 AM |
| Please help with UNIX while loop... | gerard1 | Shell Programming and Scripting | 1 | 02-01-2005 12:39 PM |
| timing a loop in unix. | wolkott | Shell Programming and Scripting | 1 | 02-04-2003 02:52 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
for loop in unix
hi,
can any one suggest why the program 2 is not working. only difference is for ab in *.txt for ab in a_DATA.txt b_DATA.txt c_DATA.txt ------------------------------------ Program :1 (working fine) #!/bin/ksh for ab in a_DATA.txt b_DATA.txt c_DATA.txt suf="_" echo "old->[${ab}] new->[${root}${suf}${_time}]" old="${ab} " new=${root}${suf}${_time} cp $old $new echo "$_time" echo "$root" echo "$new" done ======================== Program :2 (Not working ) #!/bin/ksh for ab in *.txt suf="_" echo "old->[${ab}] new->[${root}${suf}${_time}]" old="${ab} " new=${root}${suf}${_time} cp $old $new echo "$_time" echo "$root" echo "$new" done Thanks in advance !! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|