I am trying to copy a .sh file into 'bin/sh' directory, but I am not able to access 'sh'. Is there any way or command to copy .sh file to 'sh' directory?
If you make your own sh script and want it to be found and executed from your shell prompt you:
Change rights for the script file myscript.sh
chmod +w myscript.sh
or
chmod 755 myscript
etc.. depending on who is allowed to execute and change the script.
You can test this from the prompt before changing .bashrc if you (example in bash) do
export PATH=$PATH:~/myscripts/
For scripts you have put in your own directory myscripts. To put it into /usr/bin you do
sudo cp myscript.sh /usr/bin/.
If you do not have any sudo rights, you are bound to the latter solution with a directory of your own where you put your sh files and changing the PATH.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.