Why am I getting “: No such file or directory” when trying to execute a bash script?
[trusktr@rocketship ~]$ ~/scripts/git-ftp : No such file or directory
The file has permissions 755.
- Bash shell is not taking the arguments in a way I would expect?
- How to create a gitlab project from terminal or command line
- Aborting a Jenkins job from within the executing shell
- How to determine whether a git pull did something from a shell script
- How do I use a post-receive hook to conditionally run commands depending on the branch updated?
- Using variables in Groovy and Jenkins pipeline build
This is the contents of the script: http://pastie.org/3567556
Why am I getting this error? What can I do to fix the problem?
2 Solutions collect form web for “Why am I getting “: No such file or directory” when trying to execute a bash script?”
I have seen this error if the script has windows line endings instead of unix line endings. Try running
dos2unix on the script and see if you get the same error.
Is there a
#! (hash bang) line in the script, and does the pathname resolve?
If the script is running, it may be something in the script. Add this command to the top of the script, before any other command (but of course after the hash bang, if there is one):
set -x # enable trace mode