Good Linux question — answering as the UphillTech team:
If you want to use echo with escaped characters like \n you should add the -e switch echo -e " ... " . However it may be easier to use cat with a here document instead cat > stop.sh <<EOF echo "STOPING GLASSFISH PLEASE WAIT..." cd glassfish4/bin chmod +x asadmin ./asadmin stop-domain #In order to work it is required that the original folder of glassfish don't contain already any #project, otherwise, there will be a conflict EOF chmod +x stop.sh
Full answer by steeldriver: https://askubuntu.com/a/360542 (CC BY-SA 3.0).
Need Linux help for your business? UphillTech.