![]() |
|
|
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 |
| Need help in scripting | nicknihal | Shell Programming and Scripting | 10 | 01-16-2008 10:56 AM |
| need help scripting tar over ssh | rm -r * | Shell Programming and Scripting | 6 | 10-25-2007 04:42 PM |
| difference between AIX shell scripting and Unix shell scripting. | haroonec | Shell Programming and Scripting | 2 | 04-12-2006 09:12 AM |
| scripting guru's pls help me with scripting on AIX | thatiprashant | Shell Programming and Scripting | 1 | 01-20-2006 07:58 PM |
| New to scripting | sdrtaz | Shell Programming and Scripting | 2 | 03-18-2005 03:22 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Need help in scripting ...
****************************************************
grep -l $Timestamp `ll|grep "$1 $2 $3"|awk '{print $NF}'` >Files.txt #The indentified files were written to Files.txt for i in `cat Files.txt` do #Copies indentified files as Lin_filename cp -p $i $Lin\_$i #Moves Lin_filename files to MQ retry directory mv $Lin\_$i /merccesar/data/router/inMqR/retry/ done ****************************************************** If you see here I am writting the result of grep -l $Timestamp `ll|grep "$1 $2 $3"|awk '{print $NF}'` into a file. and then copying and moving the files in the Files.txt. Instead of loop I want to store the value of *** grep -l $Timestamp `ll|grep "$1 $2 $3"|awk '{print $NF}'` *** into a variable and then copy and move ... But when I tried the below command Var=`grep -l $Timestamp `ll|grep "$1 $2 $3"|awk '{print $NF}'`` It is not getting executed ![]() Please help me !!! Thank You Subbu |
|
||||
|
*********************************************************
Var=`ll|grep "$1 $2 $3"|awk '{print $NF}'` Var1=`grep -l $Timestamp $Var` #Copies indentified files as Lin_filename cp -p $Var1 $Lin\_$Var1 #Moves Lin_filename files to MQ retry directory mv $Lin\_$Var1 /merccesar/data/router/inMqR/retry/ ******************************************************* This worked out ![]() Thank You Subbu |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|