as root I execute the fs.sh script located in / var /
script:
#!/bin/bash -x echo 1 cd / I get the error:
root@bill2:/var# bash fs.sh 1 : No such file or directory root@bill2:/var# Help me figure out why the script can’t get into the directory, and if I type cd / in the console, I’m fine.
File contents:
$ od -bc fs.sh 0000000 043 041 057 142 151 156 057 142 141 163 150 040 055 170 015 012 # ! / bin / bash - x \r \n 0000020 145 143 150 157 040 061 015 012 143 144 040 057 015 012 echo 1 \r \ncd / \r \n 0000036
hd(orod -bc) - avpnanoorgedit,kate? Here is direct from the question to copy and paste already in the editor? - don Rumata\rat the end of the lines, remove (i.e., the lines should end with\n) (well, at the very least, if you don’t cope, then after/incd /type a space (several)) - avp