![]() |
|
|
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 |
| weird file list problem | jmmora | AIX | 8 | 08-08-2008 12:18 PM |
| Weird date difference problem | meeraKh | Shell Programming and Scripting | 22 | 03-12-2008 11:50 PM |
| Weird crontab problem | RobSand | SUN Solaris | 8 | 10-09-2007 06:12 PM |
| weird problem with removing files | rein | UNIX for Advanced & Expert Users | 2 | 08-15-2005 08:51 AM |
| Weird Problem??? | danhodges99 | UNIX for Dummies Questions & Answers | 2 | 04-11-2003 12:05 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi Guys..
I have a script which is: #!/bin/ksh for file in `grep qtc $PIC_SHS/xback00.ksh |cut -d"=" -f2` do ls $file cp $file ./ done output of grep is $ grep qtc $PIC_SHS/xback00.ksh |cut -d"=" -f2 $PIC_BIN/XPBACKRC0.qtc $PIC_BIN/XPBACK000.qtc $PIC_BIN/XPBACKSS0.qtc $PIC_BIN/XPBACKSP0.qtc $PIC_BIN/XPBACKAL0.qtc $PIC_BIN/XPBACKBO0.qtc $PIC_BIN/XPBACKTC0.qtc $PIC_BIN/XPBACKFC0.qtc $PIC_BIN is a environment variable. $ ls -l $PIC_BIN/XPBACKRC0.qtc -rwxrwxrwx 1 ddshupmg gmwms 8448 Feb 7 2007 /disk1/uketddshup/common/bin/XPBACKRC0.qtc the files exist.. but when give the grep output as input list to for loop, it doesnt evaluate it.. and gives an error like : $ ./copy.ksh $PIC_BIN/XPBACKRC0.qtc: No such file or directory cp: cannot access $PIC_BIN/XPBACKRC0.qtc $PIC_BIN/XPBACK000.qtc: No such file or directory cp: cannot access $PIC_BIN/XPBACK000.qtc $PIC_BIN/XPBACKSS0.qtc: No such file or directory cp: cannot access $PIC_BIN/XPBACKSS0.qtc $PIC_BIN/XPBACKSP0.qtc: No such file or directory cp: cannot access $PIC_BIN/XPBACKSP0.qtc $PIC_BIN/XPBACKAL0.qtc: No such file or directory cp: cannot access $PIC_BIN/XPBACKAL0.qtc $PIC_BIN/XPBACKBO0.qtc: No such file or directory cp: cannot access $PIC_BIN/XPBACKBO0.qtc $PIC_BIN/XPBACKTC0.qtc: No such file or directory cp: cannot access $PIC_BIN/XPBACKTC0.qtc $PIC_BIN/XPBACKFC0.qtc: No such file or directory cp: cannot access $PIC_BIN/XPBACKFC0.qtc Any idea how to evaluate the variable in for loop.. at shell level it works.. ![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|