"!#/bin/bash: No such file or directory"? When running a script
Hi so I'm a new Linux user and I was programming a script for class, which is a pretty simple script. I have already made it executable and when I call the program I type ./myscript so that isn't the problem. For some reason it has a problem with the way I typed my first line I believe. My script simply begins, right off the bat, with a
#!/bin/bash Anyone know what the problem is? Any help would be extremely appreciated :( |
Hi, welcome to LQ!
Edited in windows? You may have a trailing '^M' Cheers, Tink |
Not exactly, I have a VirtualBox running Ubuntu, so the file has never been edited in any other format. Could I be missing a certain file for bin/bash? That wouldn't make any sense. But this command is required for scripts to run so I'm feeling a little hopeless at this point.
|
What's the output of
Code:
which bash Code:
echo $PATH |
which bash:
Code:
/bin/bash Code:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games |
Ok, that looks normal ....
Next question: In your posts body you have Code:
#!/bin/bash Code:
!#/bin/bash |
Okay, just know that this is the first script I wrote, and since I haven't been able to run it at all, I haven't got a chance to debug or figure out what was wrong in it. I think the first line is the most crucial problem =/
Code:
#!/bin/bash |
Except for the missing do under while and the fact that
"print" is not a bash command it looks OK. Should work, is what they say (well, and the tests need some honing). |
Yeah, when I call the program, it just says gives me:
Code:
./combine: line 1: !#bin/bash/: No such file or directory |
Quote:
Now you produced a THIRD variant, which is wrong (similar to the one in the subject): It's Code:
#!/bin/bash Code:
#!bin/bash |
Ohhhhhh man... I made some terribly stupid mistakes with this code. I looked at examples over and over again and I swore I had everything in the right place.
Thank you so much Tinkster!!!! :) |
Most welcome, and:
No worries - we all have those days ;} |
Good to see your solution finally came about, please remember to mark as SOLVED.
|
All times are GMT -5. The time now is 03:27 PM. |