0

I'm going through a shell script coded by some old folks working on my current project. At the end of a file, it simple have the folder/file paths like,

/home/udhay-dev/work/udhay/bin/rm-vhosts
/home/udhay-dev/work/udhay/bin/vhosts
/home/udhay-dev/work/udhay/bin/apache

at the end of file. When these lines are executing, it throws

vhost.sh: line 22: /home/udhay-dev/work/udhay/bin/rm-vhosts: Is a directory
vhost.sh: line 23: /home/udhay-dev/work/udhay/bin/vhosts: Permission denied
vhost.sh: line 24: /home/udhay-dev/work/udhay/bin/apache: Is a directory

But i don't have any idea on these since i'm almost new to both Ubuntu and Shell script. What would be the reason or purpose for simply having those lines in a shell script? Please help.

0
vhost.sh: line 22: /home/udhay-dev/work/udhay/bin/rm-vhosts: Is a directory

Shows there is directory named rm-vhosts inside /home/udhay-dev/work/udhay/bin directory.

vhost.sh: line 23: /home/udhay-dev/work/udhay/bin/vhosts: Permission denied

Shows there is file named vhosts inside /home/udhay-dev/work/udhay/bin directory.

vhost.sh: line 24: /home/udhay-dev/work/udhay/bin/apache: Is a directory

Shows there is directory named apache inside /home/udhay-dev/work/udhay/bin directory.

vhost.sh is the script name.line xx means the line number in the script which throws the above message.

  • What would be the reason for simply having those lines? – Stranger May 7 '14 at 9:42
  • just to say, it's a directory. But there is no use of having these lines on the script. – Avinash Raj May 7 '14 at 9:46
  • My guess is that the developer put those lines there in order to easily copy-and-paste them, but forgot to remove them. – Jos May 7 '14 at 10:09
  • @Udhay typically that is the result of treating the directory as a command and then attempting to run it. Why did the script try to run a directory as a command is another question, usually that'd be due to a mistake in the script. – Mahn Dec 16 '14 at 21:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.