OS X shell scripts. Share, anyone?

Discussion in 'General Mac Discussion' started by suneun, Jul 16, 2002.

  1. suneun macrumors member

    Feb 5, 2002
    I was hoping that there are some of you who are unix'y and write shell scripts for fun. Does anyone want to share interesting/useful shell scripts they've come across? I'm an avid terminal user, especially since I have an account on a community server ( http://www.techhouse.org ).

    I would suggest that if they're short, you could post the code here. Else, you could post it on your own webpage and mention the link.

    Here's one I didn't write, which is actually a perl script I love using. It takes the command "webster word" and fetches back definitions.
  2. bousozoku Moderator emeritus

    Jun 25, 2002
    Gone but not forgotten.
    Okay, here's one I use to determine how far folding@home is.

    I call it sl.csh (sl for show log). It resides in the folder with the main fah application. The output looks like:

    - Frames Completed: 45, Remaining: 55
    Finished a frame (46)
    Finished a frame (47)
    -rw-r--r-- 1 bousozok staff 630928 Jul 27 00:52 wudata_03.arc

    Here's the code:

    # show the logfile contents
    cd ../Library/Folding@home/work/
    foreach file (logfile_??.txt)
    grep "[Ff]rame" $file
    # also list the file .arc file for time
    ls -l *.arc

Share This Page