GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   what's the equivalent of -e in ssh (https://gfy.com/showthread.php?t=449593)

Zester 03-29-2005 03:39 AM

what's the equivalent of -e in ssh
 
i'm using something like this to determine if a file exists in Perl:
if(-e "myfile")

how do I do in an .sh file without getting a "No such file or directory" output like I get when I use the "ls" command?

darksoul 03-29-2005 04:01 AM

if [ -e "file.txt" ]; then
echo "Wow its there";
fi

Zester 03-30-2005 12:17 AM

Quote:

Originally Posted by darksoul
if [ -e "file.txt" ]; then
echo "Wow its there";
fi


thanks.
now I'm going to use the "ls" command anyway for something else.
is there a way to suppress the error message: "No such file or directory"
if there really is no such file or directory ?


All times are GMT -7. The time now is 08:44 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123