• Post Reply Bookmark Topic Watch Topic
  • New Topic

What's wrong with it?  RSS feed

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i've created a simple script called "do" in linux and put it in /home/RnD/bin. i also set PATH to point to that directory e.i. PATH points to /home/RnD/bin. when i execute it like this,
[root@localhost me]# do
gives me the following error msg:
bash:syntax error near unexpected token 'do'
but if i run it by typing like this:
[root@localhost me] #/home/RnD/bin/do
it works. what's wrong with the previous one?
by the way, PATH is set in bash_profile file.
himal
 
Saloon Keeper
Posts: 18800
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"do" is the name of the looping construct for the shell, and there are actually people so devious that they code such things in at the console.
Normally the current directory is not part of the path (unlike DOS/Windows), so the more correct command would be "./do" anyway. Assuming you had the "x" attribute set.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!