when i run sh backuptest.sh, following error comes .So is it issue with the code or my shell
result :
: not foundsh: 2: backuptest.sh:
: not foundsh: 4: backuptest.sh:
: not foundsh: 6: backuptest.sh:
: not foundsh: 7: backuptest.sh:
content of backuptest.sh
#!/bin/sh -e
location=`date +%Y%m%d`.sql
mysqldump -u root -proot spider_db > $location
Which of the following loops is not available in shell? Explanation: The foreach loop is not available in shell. 2. The _______ loop executes the given commands until the given condition remains true.
Create a freestyle project on Jenkins. Use the advanced configuration page to use custom workspace. Add the path to your shell script. Under the build step, select "execute shell"
$'\r' is a representation of the carriage return character (CR) that is part of traditional DOS and Windows line endings (CR LF), but which is absent in traditional Unix-style line endings (LF).
remove #!/bin/sh -e
and try
dos2unix backuptest.sh
then execute again with
./backuptest.sh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With