Results 1 to 7 of 7
  1. #1
    Darwin Commands - How?

    Member Since
    Sep 25, 2006
    Location
    NJ
    Posts
    31
    Specs:
    12" iBook; G4; 1.07 GHz; 512 MB; 30 gig; Combo Drive; Radeon 9200
    Red face 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?

  2. #2
    Darwin Commands - How?
    rman's Avatar
    Member Since
    Dec 24, 2002
    Location
    Los Angeles, California
    Posts
    12,584
    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
    Cool
    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!

  3. #3
    Darwin Commands - How?

    Member Since
    Sep 25, 2006
    Location
    NJ
    Posts
    31
    Specs:
    12" iBook; G4; 1.07 GHz; 512 MB; 30 gig; Combo Drive; Radeon 9200
    Quote Originally Posted by rman
    Normally the shell script will have what shell to as the first line.
    Kinda lost me there :confused:

  4. #4
    Darwin Commands - How?
    MacsWork's Avatar
    Member Since
    May 22, 2005
    Location
    Closer than you think.
    Posts
    2,159
    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.

  5. #5
    Darwin Commands - How?

    Member Since
    Sep 25, 2006
    Location
    NJ
    Posts
    31
    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?

  6. #6
    Darwin Commands - How?
    Aptmunich's Avatar
    Member Since
    Mar 09, 2004
    Location
    Munich
    Posts
    9,073
    Specs:
    Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
    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

  7. #7
    Darwin Commands - How?
    olias's Avatar
    Member Since
    Oct 01, 2006
    Posts
    27
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Terminal Commands
    By Destructive in forum OS X - Development and Darwin
    Replies: 11
    Last Post: 02-19-2008, 09:41 PM
  2. Using Keyboard Commands?
    By jennymac in forum Switcher Hangout
    Replies: 9
    Last Post: 10-02-2007, 07:49 PM
  3. Darwin Commands
    By CyberCandy in forum OS X - Operating System
    Replies: 6
    Last Post: 01-31-2005, 03:46 PM
  4. commands.
    By daveo in forum Apple Notebooks
    Replies: 0
    Last Post: 10-24-2004, 05:50 PM
  5. commands?
    By newtomacs in forum OS X - Development and Darwin
    Replies: 4
    Last Post: 06-15-2004, 03:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •