The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
FreeBSD Support
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 link to a program and include switches
Author: cetae 
Date:   05-11-05 18:00

How would i create a link to a program to include switches.

Ex. create a link such as mountcd, which would call: mount -t cd9660 /dev/acd0 /cdrom

i tried a symbolic link with ln but it did not work. maybe using a script? I am not sure. I have seen something similar to this at work, using find, but i do not have access to look at the file.

Thanks for any insight on this problem.

Reply To This Message
 
 Re: link to a program and include switches
Author: halber_mensch 
Date:   15-11-05 21:01

What you're looking for is not a symlink. symlinks are file system structures, and don't affect the vm machinery at all.

What I believe you are trying to do is introduce a script or an alias to run this command for you.

you could make a file named mountcd;
----------------------------------------------
#!/bin/sh
mount -t cd9660 /dev/acd0 /cdrom
----------------------------------------------

chmod a+x mountcd

then throw it in /usr/local/bin or something.

More appropriately, you could make an alias:

#alias mountcd mount -t cd9660 /dev/acd0 /cdrom

you can also place that command in your .profile or .login

But the most correct way is to use /etc/fstab.
Insert the following line to /etc/fstab:
/dev/acd0 /cdrom cd9660 ro,noauto 0 0

From then on, you can do

#mount /cdrom

to mount your cdrom.

As a point of interest, non-root users by default cannot mount file systems.

Reply To This Message
 
 Re: link to a program and include switches
Author: cetae 
Date:   16-11-05 00:42

thank you very much, that is exactly what i wanted to do.

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org