Writing a very simple script, the results are very strange.
1 #!/bin/bash 2 3 path= $HOME/vlc_transplant4 4 5rm -F $PATH/ VLC6Ln -S $PATH/bin/vlc-static $PATH /vlc
Execution Result:
[Email protected]:~/vlc_transplant4$./update. SH . /update. SH 5 RM : Command not found. /update. SH 6 LN: Command not found
The reason is that the path variable that you define in the script replaces the system variable path, and the script originally uses the system variable path to find the command (RM, LN), and now the path is redefined in the script as $home/Vlc_transplant4, and the script takes precedence over this definition.
Change the path name in the script to change it.
1 #!/bin/bash 2 3 _path= $HOME/vlc_transplant4 4 5rm -F$_path/ VLC6Ln -S $_path/bin/ Vlc-static $_PATH/VLC
Shell script variable definition be careful not to duplicate the name of the system variable ...