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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Aliases

Status
Not open for further replies.

darfader

Programmer
Aug 6, 2003
38
GB

Hi,

how do aliases work ?

I want to capture a long path into a simple alias like

/inputdec/export/switch/pac/work

but I keep getting the same error

$ alias pmc=/inputdec/export/switch/pac/work
$ cd pmc
ksh: pmc: not found
$ alias pmc /inputdec/export/switch/pac/work
pmc=/inputdec/export/switch/pac/work
ksh: /inputdec/export/switch/pac/work: invalid alias name
$ alias /inputdec/export/switch/pac/work pmc
ksh: /inputdec/export/switch/pac/work: invalid alias name
$


tia,
 
IMHO aliases are for commands. Why not using variables ?
Try someting like this:
Code:
$ export pmc=/inputdec/export/switch/pac/work
$ cd $pmc
$ pwd

Hope This Help
PH.
 
If you really wanted to have a simple alias (without having to type the "$"), you could use ...

$ alias pmc='cd /inputdec/export/switch/pac/work'


then,typing...

$ pmc
$ pwd
/inputdec/export/switch/pac/work

angel.gif
 
thanks Duane61,

I have decided on the variable approach, however, I'm using your alias method for this

alias ll='ls -al'

:)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top