0

I am mounting a directory /dev/xyz to folder /abc using command

   mount --bind /dev/xyz 
   /abc

How could I use this command using shell script?

2 Answers2

1
echo "mount --bind /dev/xyz /abc" >mount.sh && chmod 755 mount.sh && ./mount.sh
0

Almost the same way. Just create a bash script:

vi mount.sh

Insert or i is responsible for inserting. Right button of the mouse for pasting. Esc for exiting the insert mode, Then all you have to do after Esc is to type :x to save and exit the bash script file edition mode.

Add a shebang check what shebang is at Wikipedia

Add a command to the file below the shebang.

mount --bind /dev/xyz /abc

Make bash script executable using

chmod +x mount.sh
Sysadmin
  • 284