|
|
a couple shell things
hey folks,
i thought i'd take this opportunity to expand on this example and hopefully teach some of y'all some new shell tricks. colin lets us know that we can start filesharing with these two commands.
cd /usr/sbin ./applefileserverthis does two things. first, we change our working directory to /usr/sbin. then, we tell the shell to run the file applefileserver in our current directory. the character "." is how the shell refers to the current directory. "." is pronounced "dot". so, the second line of colin's example would be pronounced "dot slash applefileserver". it's true :) anyway, unix has the notion of a PATH. your PATH is the list of directories the shell will look in when you give it the name of an application to run. you can see your path by running echo $PATHyour PATH is displayed as a colon separated list of directories. you can see other environment variables with the envcommand. /usr/sbin is not normally in a users PATH, so if we just typed applefileserverthe shell wouldn't find it. to get around this, colin just changed to the /usr/sbin directory and told the shell to run the file applefileserver in the current directory. there are atleast two other solutions. you can always just tell your shell the absolute path to the application, as in /usr/sbin/applefileserveror you can add /usr/sbin to your PATH. in bash, export PATH=$PATH:/usr/sbinthis tells your shell to add the directory /usr/sbin to the current value of $PATH. note, that this is only true until you logout from your shell. you can create a file to tell your shell to do this everytime you login. in bash, edit or create a file in your home directory called .bash_profile and add the line export PATH=$PATH:/usr/sbinto the file. then, everytime you login, /usr/sbin will be in your PATH. anyone else know how to do it for other shells? mike
a couple shell things
>anyone else know how to do it for other shells? |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|