New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

OS 10.4 - Darwin Commands - How?


Post Reply New Thread Subscribe

 
Thread Tools
msb86

 
Member Since: Sep 25, 2006
Location: NJ
Posts: 31
msb86 is on a distinguished road
Mac Specs: 12" iBook; G4; 1.07 GHz; 512 MB; 30 gig; Combo Drive; Radeon 9200

msb86 is offline
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?

QUOTE Thanks
rman

 
rman's Avatar
 
Member Since: Dec 24, 2002
Location: Los Angeles, California
Posts: 12,591
rman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud of
Mac Specs: 2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi

rman is offline
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).

Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!
QUOTE Thanks
msb86

 
Member Since: Sep 25, 2006
Location: NJ
Posts: 31
msb86 is on a distinguished road
Mac Specs: 12" iBook; G4; 1.07 GHz; 512 MB; 30 gig; Combo Drive; Radeon 9200

msb86 is offline
Quote:
Originally Posted by rman
Normally the shell script will have what shell to as the first line.
Kinda lost me there :confused:

QUOTE Thanks
MacsWork

 
MacsWork's Avatar
 
Member Since: May 22, 2005
Location: Closer than you think.
Posts: 2,145
MacsWork is just really niceMacsWork is just really niceMacsWork is just really niceMacsWork is just really niceMacsWork is just really nice
Mac Specs: Performa 6116 2GBSCSI 8MB OS 7.5.3

MacsWork is offline
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.
QUOTE Thanks
msb86

 
Member Since: Sep 25, 2006
Location: NJ
Posts: 31
msb86 is on a distinguished road
Mac Specs: 12" iBook; G4; 1.07 GHz; 512 MB; 30 gig; Combo Drive; Radeon 9200

msb86 is offline
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?

QUOTE Thanks
Aptmunich

 
Aptmunich's Avatar
 
Member Since: Mar 09, 2004
Location: Munich
Posts: 9,075
Aptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant futureAptmunich has a brilliant future
Mac Specs: Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2

Aptmunich is offline
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.

http://www.faqs.org/faqs/unix-faq/sh...l-differences/

http://en.wikipedia.org/wiki/Unix_shell
QUOTE Thanks
olias

 
olias's Avatar
 
Member Since: Oct 01, 2006
Posts: 27
olias is on a distinguished road

olias is offline
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

A wise man realizes that he too is a fool and then humbles himself to learn that which is greater than he.
QUOTE Thanks

Post Reply New Thread Subscribe


« wrong HOSTTYPE ... I think | Problem with Darwine »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Help! OSX exits to Darwin bobwinn OS X - Development and Darwin 2 04-11-2005 11:45 PM
Darwin Commands CyberCandy OS X - Operating System 6 01-31-2005 03:46 PM
trying to figure out darwin TylerMoney OS X - Development and Darwin 2 02-20-2004 01:45 PM
Darwin Streaming Server FancyPants Web Design and Hosting 2 01-09-2004 11:35 AM
Apple Darwin OS 6.6 released Graphite OS X - Development and Darwin 0 05-14-2003 07:35 PM

All times are GMT -4. The time now is 11:01 PM.

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

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?