Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A shell script to set Terminal window colors per SSH host' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A shell script to set Terminal window colors per SSH host
Authored by: jdsmith on Aug 03, '05 12:43:14PM
The script already works that way. It can either take a single argument (the ssh host name), or use the base name of the linked command name. To get your functionality, simply:
% alias ssh ssh_host
% ssh hostname

By the way, the ".sh" in the name of the downloaded file is just there to ensure the special characters are downloaded correctly. It can safely be stripped, so the script is just called ssh_host.

For the interested, host=${1:-${0##*/}} is just shell magic for "use the first argument, unless it isn't set, in which case use the command name, stripped of any leading path". JD

[ Reply to This | # ]