![]() |
|
|
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 |
| gzcat into awk and then change FILENAME and process new FILENAME | timj123 | Shell Programming and Scripting | 6 | 06-23-2008 08:45 AM |
| Possible to track FTP user last login? Last and Finger don't track them. | LordJezo | UNIX for Dummies Questions & Answers | 1 | 11-08-2007 01:21 PM |
| how to read double consecutive space in filename for bash shell | james_falco | UNIX for Dummies Questions & Answers | 1 | 07-17-2007 05:32 PM |
| How to send filename as variable in a shell script | gthokala9 | Shell Programming and Scripting | 6 | 06-27-2006 02:23 PM |
| sed / shell - how to use $filename | eadie | Shell Programming and Scripting | 5 | 06-28-2004 11:10 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Guys I am trying to install the pkg using the follwoing script.
Trying to run the script from one machine to other machines with the follwoing code. Now my problem is, when I use scp command on the remote machine, how do i keep track of filename in some variable or that sort of thing. Below is the sample code. for GETHOST in `cat $FILENAME` do echo "\n Logging onto $GETHOST" ssh $GETHOST <<EOT #Getting the machine info for Sparc / AMD machine TYPE=`uname -a | awk '{print $6}'` if [ $TYPE != sparc ]; then scp beast:$AMD_DIR/*.pkg.tar.gz $GETHOST:/home/somename/pkg/ if [ $? = 0 ]; then echo " Copied the file(s) Successfully on $GETHOST from beast" else echo " File(s) not copied on $GETHOST from beast" exit 2 fi [Here I have to keep track of all the recent files that have been scp'ed]or suggest any other alternative or any other condition please] else scp beast:SPARC_DIR/*.pkg.tar.gz $GETHOST:/home/somenam/pkg/ if [ $? = 0 ]; then echo " Copied the file(s) Successfully on $GETHOST from beast" else echo " File(s) not copied on $GETHOST from beast" exit 2 [SAME LIKE ABOVE - Here I have to keep track of all the recent files that have been scp'ed]or suggest any other alternative or any other condition please] fi fi # Better to check once again if scp is successfull # End of here document EOT # End of main for loop done |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|