Napsty / scripts

Just a bunch of handy scripts
GNU General Public License v2.0
63 stars 44 forks source link

Error when run the script #2

Closed buzzing-bee closed 5 years ago

buzzing-bee commented 5 years ago

I got error when I run the script on Ubuntu 18.04

walarchivecleanup.sh: line 28: $'\r': command not found walarchivecleanup.sh: line 32: syntax error near unexpected token $'do\r'' 'alarchivecleanup.sh: line 32:do

Napsty commented 5 years ago

That's weird. Are you sure you copied the script correctly? Can you show the full output of the script running it with bash -xv? Example: bash -xv ./walarchivecleanup.sh -p /var/lib/postgresql/9.6/main/archive -a 10 Adapt to your own environment, the way you wanted to run the script.

buzzing-bee commented 5 years ago

sorry, my bad. Your script is running just fine. just need to make the script in unix format.

I found solution to my problem earlier from here: https://stackoverflow.com/questions/27176781/bash-file-returns-unexpected-token-do-r/43004720

Thank's for your script, it's a live safer

baraalfa commented 5 years ago

i run, walarchivecleanup.sh: 34: walarchivecleanup.sh: Syntax error: word unexpected (expecting "do")