Why sed interprets the filename given in the variable wrong? (/etc/postgresql/9.6/main/postgresql.conf interpreted as esql/9.6/main/postgresql.conf)
script:
#!/bin/bash
set -ex
...
echo "$psql_config_file"
${ssh_login} sudo -Hiu postgres sed -i 's/[#]*wal_level\ =.*#/wal_level\ =\ archive\ #/g' "$psql_config_file"
output:
+ echo $'/etc/postgresql/9.6/main/postgresql.conf\r'
/etc/postgresql/9.6/main/postgresql.conf
+ ssh -t user@192.168.42.133 sudo -Hiu postgres sed -i 's/[#]*wal_level\=.*#/wal_level\ =\ archive\ #/g' $'/etc/postgresql/9.6/main/postgresql.conf\r'
: No such file or directoryesql/9.6/main/postgresql.conf