Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make an OS executable file like in DOS *.bat 2

Status
Not open for further replies.

akgta

Programmer
Jul 18, 2007
42
CA
how to make an OS executable file like in DOS *.bat

for eg everytime i have use CDROM i have to type the following code on the prompt:

cd /cdrom
touch CDROM-NOT-mounted-mcd.txt
mount -t cd9660 /dev/acd0 /cdrom

thanks in advance
 
You can put your code into a shell script abd call it (for example) mountcd.sh

Then change the permissions so that the script is executable:

chmod 755 mountcd.sh

Then execute it using ./mountcd.sh

Hope this helps.

I want to be good, is that not enough?
 
You can use this code, just add it to a file like so:

#!/bin/sh
cd /cdrom
touch CDROM-NOT-mounted-mcd.txt
mount -t cd9660 /dev/acd0 /cdrom

Then, you chmod +x <insert filename of script here>
Then ./<insert filename of script here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top