![]() |
|
|
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 |
| some information on error checking | vinayrao | Shell Programming and Scripting | 1 | 03-14-2008 12:07 PM |
| Error checking a file from previous file size | stuck1 | Shell Programming and Scripting | 2 | 12-06-2007 08:39 AM |
| Need help with error checking | xianoth | Shell Programming and Scripting | 0 | 08-31-2007 12:47 PM |
| *Error: file </tmp/srw25108193> does not exist | cgege | HP-UX | 0 | 04-10-2006 04:18 AM |
| Printer Error(the Object Instance Test Does Not Exist) | jav_v | UNIX for Advanced & Expert Users | 2 | 09-23-2002 11:42 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
File exist checking error
Hi all, I have following code: Code:
export USERID=user export BATCHHOSTIP=190.113.3.324 remotePath=/home/user fileName=redbook.txt EXIST=`ssh $USERID@$BATCHHOSTIP 'if [ -f $remotePath/$fileName ] ; then echo 0; else echo 1 ; fi'` echo $EXIST II run the code from other server. The redbook.txt file is exist in /home/user/ in server 190.113.3.324. I dont know why it print out "1". The program ignore that the file is exist. Then, I changed my code to: Code:
export USERID=user export BATCHHOSTIP=190.113.3.324 remotePath=/home/user fileName=redbook.txt EXIST=`ssh $USERID@$BATCHHOSTIP 'if [ -e $remotePath/$fileName ] ; then echo 0; else echo 1 ; fi'` echo $EXIST It print out "0". But, when I remove the redbook.txt from the location, the program still print out "0". Now, the code ignore the file is not exist. Anybody have idea what's going on ? thanks..
|
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|