what's the equivalent of -e in ssh

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zester
    Confirmed User
    • Jul 2003
    • 5344

    #1

    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?
    * Mainstream ? $65 per sale
    * new male contraception
  • darksoul
    Confirmed User
    • Apr 2002
    • 4997

    #2
    if [ -e "file.txt" ]; then
    echo "Wow its there";
    fi
    1337 5y54|)m1n: 157717888
    BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
    Cambooth

    Comment

    • Zester
      Confirmed User
      • Jul 2003
      • 5344

      #3
      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 ?
      * Mainstream ? $65 per sale
      * new male contraception

      Comment

      Working...