Reputation: 103397
I am able to run ssh rach@kamel
but if i try to put this in bash script
, i get command not found.
Here is the bash script in question
#!/bin/bash
ssh rach@kamel
i also tried using kamel ip address instead, still same issue.
Update Here is the Exact message
$ ./devBuild.sh
: No such file or directory../
: command not found
Update Content of cat -A devBuild.sh
$ cat -A devBuild.sh
#!/bin/bash^M$
cd ../^M$
ssh [email protected] ^M$
Update : Now am getting
$ ./devBuild.sh
: hostname nor servname provided, or not known
Upvotes: 2
Views: 872
Reputation: 91017
Do you, by any chance, have the line endings wrong? Sometimes it happens that there is a \r\n
at the end of lines instead of a mere \n
. This makes the shebang (#!
) line dysfunctional.
Could you post the result of cat -A dev.sh
, especially the first line?
Upvotes: 3