![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Capturing output from grpck command on AIX | pdtak | UNIX for Dummies Questions & Answers | 2 | 03-05-2008 10:58 AM |
| capturing line from script output and appending to a file | wally_welder | Shell Programming and Scripting | 6 | 08-31-2007 12:03 AM |
| reading command output from shell script | sri b | Shell Programming and Scripting | 4 | 11-15-2006 08:52 PM |
| Need help capturing pipe to a file in shell script | heinz | Shell Programming and Scripting | 6 | 11-03-2005 04:27 AM |
| capturing output in script | MizzGail | Shell Programming and Scripting | 6 | 06-02-2004 04:44 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I am trying to check to see if a file exists on a ftp server, well, I know that cant be done, atleast directly, So I came up with this small script
Quote:
Code:
ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD cd public_html/crap dir $FILE quit END_SCRIPT Quote:
Code:
{
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
cd public_html/crap
dir $FILE
quit
END_SCRIPT
} > $CHECK_FILE
if $CHECK_FILE = 0 {
# file does not exist, lets upload the file to the server
}
else {
# file exists on the server, rename the file on server before uploading
}
|
| Forum Sponsor | ||
|
|
|
|||
|
I am using bourne shell.
I did go on the FAQ site but I dont see an example in which we are trying to capture output generated by a script commands into a variable. Notice the bold S! |
|||
| Google UNIX.COM |