Darwin Commands - How?

Joined
Sep 25, 2006
Messages
31
Reaction score
0
Points
6
Location
NJ
Your Mac's Specs
12" iBook; G4; 1.07 GHz; 512 MB; 30 gig; Combo Drive; Radeon 9200
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


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
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).
 
OP
M
Joined
Sep 25, 2006
Messages
31
Reaction score
0
Points
6
Location
NJ
Your Mac's Specs
12" iBook; G4; 1.07 GHz; 512 MB; 30 gig; Combo Drive; Radeon 9200
rman said:
Normally the shell script will have what shell to as the first line.

Kinda lost me there :confused:
 
Joined
May 22, 2005
Messages
2,159
Reaction score
67
Points
48
Location
Closer than you think.
Your Mac's Specs
Performa 6116 2GBSCSI 8MB OS 7.5.3
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.
 
OP
M
Joined
Sep 25, 2006
Messages
31
Reaction score
0
Points
6
Location
NJ
Your Mac's Specs
12" iBook; G4; 1.07 GHz; 512 MB; 30 gig; Combo Drive; Radeon 9200
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?
 
Joined
Mar 9, 2004
Messages
9,065
Reaction score
331
Points
83
Location
Munich
Your Mac's Specs
Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
Joined
Oct 1, 2006
Messages
27
Reaction score
2
Points
3
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
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top