Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix shortcuts for frequently used commands

Status
Not open for further replies.

davidx

Programmer
Oct 6, 2000
10
US
I'm new to unix, but in previous environments I would create shortcut commands to run the frequently used OS commands.

P = lp -d sysprt2_1 filename

How would I create this short cuts in Unix?

Thanks

Dave [sig][/sig]
 
Depends on your shell. Bourne shell does not allow aliasing but korn and c do.

korn shell : -
alias P = lp -d sysprt2_1 filename

Add the line to the .kshrc file in your home directory.

csh : -
alias P "lp -d sysprt2_1 filename"

Add to .cshrc in your home directory.

There are other methods but I recomend you get used to unix first. [sig]<p>Ged Jones<br><a href=mailto:gedejones@hotmail.com>gedejones@hotmail.com</a><br><a href= > </a><br>Top man[/sig]
 
Dave -
You are looking for is an alias. The format is as follows - alias aliasname='some UNIX commands' example: alias l='ls -l'. If you run this from the command line, it will only be available in your current shell. You can put these definitions in your .profile or .kshrc file to have them available every time you log in. BTW, this is for Korn Shell only.

Hope this helps

[sig]<p>Christopher Devenny<br><a href=mailto:c_devenny@yahoo.com>c_devenny@yahoo.com</a><br><a href= > </a><br> [/sig]
 
We are using the korn shell thanks for the advice !!

[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top