Mac Forums

Mac Forums (
-   OS X - Development and Darwin (
-   -   Darwin Commands - How? (

msb86 10-23-2006 02:44 PM

Darwin Commands - How?
I'm a bit confused as to how this command works out:

sudo sh /etc/daily

This is what I know about it:

It forces the daily script to run; all daily temp files are deleted.

sudo - lets you run the command as another user (superuser, etc.)
/ect/daily - location of file

My question is what is sh? Is this a location of all mac scripts? What does it stand for?

rman 10-23-2006 04:05 PM

sh is the shell that the script is going to be run with. Normally the shell script will have what shell to run as the first line. In this case you are requesting the root user to run the daily shell script uing the bourne shell (sh).

msb86 10-25-2006 05:26 PM


Originally Posted by rman
Normally the shell script will have what shell to as the first line.

Kinda lost me there :confused:

MacsWork 10-25-2006 07:21 PM

Unlike Windows cmd,..which is like a shell,..

There are many shells that OS X can use. The default in panther was tcsh and tiger being bash I believe. Über unix geeks will argue which is better but you can specify which shell you want to run a command from within a different shell entirely since they are part of tiger already.

bash - Bourne(born) Again SHell

Imagine Unix being old and from the sixties. Then you'll find the humor in all the f-ed up stuff the hippies came up with. Add the seventies and eighties and windows still isn't here yet.

msb86 10-26-2006 01:02 PM

I didn't know OSX was that tightly knit with unix. I took a class on linux so that helps me out. That is pretty rad that you can use a different shell within another shell... what is the difference between 'em and why would I want to use one as opposed to another?

Aptmunich 10-26-2006 01:27 PM

They feature different commands, different default way of doing things etc. etc.

Think of it as a mini-os. Some prefer Windows, some prefer Linux, we like OS X.
UNiX geeks argue over Bash, sh, ksh, tcsh etc.

olias 10-29-2006 06:02 PM

Just a tip... if you type man before any shell command, you will get a manual on how it works and use "q" to quit the manual. As in this example ---> man sh

All times are GMT -4. The time now is 03:39 AM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.