J'ai installé Ubuntu bash sur ma machine Windows, afin que je puisse tester les scripts linux loin du travail. J'ai créé un scripts très simple avec un "hello world" basique et un changement de répertoire (cd), mais lors de son exécution, il affiche le hello world. Il se plante sur la ligne cd to directory.
Voici l'erreur :
$ ./test.sh
hello world
zipping away
./test.sh: line 6: cd: $'/home/fjaffer/temp\r\r': No such file or directory
./test.sh: line 7: $'\r': command not found
ffr@DP-PC:~$
Mon script test.sh
est ci-dessous :
#!/bin/bash
echo "hello world"
echo "zipping away"
dir=/home/fjaffer/temp
cd $dir
Veuillez me conseiller. Merci.