Gingercat1.png Welcome to...
GingerCat Software
We make software for the Web the Macintosh and linux
(among other things!) We hope you enjoy our site

Blog | New Site
Some os X unix scripts to share

A couple of unix scripts for Mac os X that I use which with any luck may be usefull for others!


Script 1 a netcraft query from the command line


# Start script
#!
# This script takes a url such as www.google.com and
# uses that url to generate a netcraft query which
# Gives various information about the requested url
# For Mac os X


echo Web site name with www attached:
read name
bb="http://toolbar.netcraft.com/site_report?url=http://"
cc="open"
dd=" "

dd=${cc}${dd}${bb}${name}

${dd}
# end Script


This second script is great is for generating human readable man pages

# Start script
# This script takes input and generates a
# pdf version of the related man command
# and opens it up in preview
# This is visually very easy to read and nice to
# print out some detailed documentation on a command
# Please do think of the trees though and don't print to much!

echo Enter command:
read COMMD
ecoh

man -t $COMMD | open -f -a /Applications/Preview.app/

# end script


To use either of the above scripts
create a file in your home/bin/ folder (if you don't have a bin folder you can create one) or place the files somewhere else within your unix path.

Cut and copy the information within the

# Start script

and the

# end script

markers save the changes then

"sudo chmod x+" the file

for example for the first script I might use

chmod +x netcraft
(after having saved the file called netcraft)

Quit the terminal application then re start
with luck you should be able to type the command name and then enjoy the functionality provided!





© 2006 Steve Abrahall