App - Script

Tuesday 24 October 2017, 14:10  #1
Bash - System 1 confused about something
Hasaki
  • 1 posts

if make a link /tmp/ls---->/bin/cat, then set the PATH=/tmp/, and execute ./cha11 , the shell print "ls : permisson denied"

app-script-ch11@challenge02: $ rm /tmp/ls
app-script-ch11@challenge02: $ ln -s /bin/cat /tmp/ls
app-script-ch11@challenge02: $ PATH=/tmp/
app-script-ch11@challenge02: $ $PATH
 bash: /tmp/: Is a directory
app-script-ch11@challenge02: $ ./ch11
sh: 1: ls: Permission denied
app-script-ch11@challenge02: $

if I make a link /tmp/ch1/ls---->/bin/cat, and PATH=/tmp/ch1/ ,it will work well.

Thanks for answering!