Skip to content Skip to sidebar Skip to footer

When I'm Trying to Execute Bashscript import from Notepad++ but can't Started on RHEL

a little story about the experience of building scripts with bash on linux, maybe you have experienced the same thing when creating scripts using notepad ++ or others, then you import them into Linux and run them, it doesn't work properly.

create bash on notepad ++
create bash on notepad ++


Fortunately there is a very helpful standard output.

bad interpreter
bad interpreter

-bash: ./test_backup.sh: /bin/bash^M: bad interpreter: No such file or directory


Maybe because the characters in notepad ++ that I use don't work in linux itself, causing the script to not run.

To fix this is very easy to run the command below :

# sed -i -e 's/\r$//' "your_bashscript.sh // For your case
# sed -i -e 's/\r$//' test_backup.sh  // my case

And you have to believe in magic, rerun your bashscript and see what happens. try running your bashscript again, and I ask for help praying first

# ./test_backup.sh
Success hit bashscript
Success hit bashscript
Bangkit Ade Saputra
Bangkit Ade Saputra Hard-working professional with experience and a proven knowledge of operating system, server architecture and system configuration.

Post a Comment for "When I'm Trying to Execute Bashscript import from Notepad++ but can't Started on RHEL"