Hi Friends,
Can you please tell me how to create short form for directories?
like,
this is a directory: /usr/tmp/progs/scripts
when i give cd $short_name, it should take to the above path.
in which env setting do i have to set?
Thanks,
Rashmy.
short_name=/usr/tmp/progs/scripts
for bash at least:
CDPATH=./:<PATH TO BASEDIR>
should work - i.e. will let you cd to dir's within BASEDIR
or if that's not quite what you mean, use ln to make a link....
Slick1
January 16, 2008, 4:58am
4
Use the link command ... it's easier.
are these commands scope is upto session?
i want that short_variable to be exist for any session..
Hi,
I believe that the ln command would help solve your problem.
you could try using the following command:
ln -s /usr/tmp/progs/scripts <any name>
eg: ln -s /usr/tmp/progs/scripts ~/scrilink
so you can do : cd ~/scrilink
This is my first post in this forum. hope you find it useful.
but the ln is used to create a link for files r8?
i want to do it for directory.
if i give cd $tmp
means
it should take me to the diectory defined in the tmp variable.
cero
January 26, 2008, 11:30am
8
If your scope is all sessions started by your user your users profile or environment file is the best place to define a variable.
For example if you use ksh those files would be .profile in your homedirectory or the file pointed to by the ENV variable.
There you could write
export short_name=/usr/tmp/progs/scripts
In case your scope is sessions of any user there are some global profiles - but I'd be careful when meddling with them.
cero:
If your scope is all sessions started by your user your users profile or environment file is the best place to define a variable.
For example if you use ksh those files would be .profile in your homedirectory or the file pointed to by the ENV variable.
There you could write
export short_name=/usr/tmp/progs/scripts
In case your scope is sessions of any user there are some global profiles - but I'd be careful when meddling with them.
yah i got it frnd... its working... tnk very much..
i have asked one more help.. please help me with that.its all about shell script.