Possible Duplicate:
Bash/Korn shell script edited on Windows throws error ‘…^M: not found’
I'm writting an Upstart job to run Postgresql:
description "PostgreSQL 9.1 Server"
author "PostgreSQL"
start on runlevel [2345]
stop on runlevel [016]
respawn
pre-start script
if [ -d /var/run/postgresql ]; then
chmod 2775 /var/run/postgresql
else
install -d -m 2775 -o postgres -g postgres /var/run/postgresql
fi
end script
exec su -c "/usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf" postgres
If I run separate command directly from shell, they work fine. However, if they are run through Upstart... the folder gets named /var/run/postgresql?
.
Note the question mark at the end. Why does it occur??
ls
shows a?
, right? That?
actually stands for an unprintable character, to wit, a carriage return (CR, ^M). See Bash/Korn shell script edited on Windows throws error '...^M: not found' for the rest of the story. – Gilles 'SO- stop being evil' Dec 09 '12 at 23:00