![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| bash search function | doze | Shell Programming and Scripting | 3 | 09-30-2008 06:06 PM |
| [BASH - KSH] Passing array to a function | ripat | Shell Programming and Scripting | 3 | 04-17-2008 09:17 AM |
| Need help in using power function in Bash | ahjiefreak | Shell Programming and Scripting | 3 | 03-26-2008 04:31 AM |
| Need assistance with bash function | _jade_ | Shell Programming and Scripting | 1 | 03-05-2008 06:02 PM |
| Mimic bash history behavior | sysera | Shell Programming and Scripting | 0 | 10-13-2005 05:48 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hello all, I have a bash function that opens Safari (I'm on OS X) with a specified argument. Here it is : Code:
function safari
{
#Safari bash function
TLDS=( "http://www." ".com" ".org" ".net" ".gov" ".edu" )
if [ $1 = "-o" ]; then
open -a Safari ${TLDS[0]}$2${TLDS[2]}
elif [ $1 = "-n" ]; then
open -a Safari ${TLDS[0]}$2${TLDS[3]}
elif [ $1 = "-g" ]; then
open -a Safari ${TLDS[0]}$2${TLDS[4]}
elif [ $1 = "-e" ]; then
open -a Safari ${TLDS[0]}$2${TLDS[5]}
elif [ $1 = "-c" ]; then
open -a Safari ${TLDS[0]}$2${TLDS[1]}
else
open -a Safari ${TLDS[0]}$1${TLDS[1]}
fi
}
I don't have a problem with the function, but I would like to know if my function can have a command history, like after each argument is taken, is it possible that i could write it to a file for later retrieval? for example after a ( this is my prompt ) : (%) ~ <-- safari arstechnica // opens Safari @ arstechnica.com (%) ~ <-- safari ars[TAB] // completes as arstechnica after reading file
|
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|