Solved

ALIASES  sourcing .cshrc file

Posted on 1998-10-15
3
293 Views
Last Modified: 2010-04-21
i would like to know how to setup an alias that will go from the current directory to home dir and source the .cshrc file and return to the original working directory

eg.
I'm in /Home/MyDirectory

to source, I need to go to the /Home directory

and then I want to go back to /Home/MyDirectory automatically.
0
Comment
Question by:ShannonBoy
3 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 2007423
alias setup 'pushd /Home;source .cshrc;popd'
0
 
LVL 1

Accepted Solution

by:
vulkanr earned 50 total points
ID: 2007424
what's wrong with : alias x "source ~/.cshrc" ??

anyway, if this was not the meaning, try:
alias x "(cd ; source .cshrc)"

the ( ) will cause the commands to run under the same process and when it terminates you will get back where you were.
0
 

Author Comment

by:ShannonBoy
ID: 2007425
ozo your comment doesnt work sorry...

but vulkanr solved it excellent, thank bud!!!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AIX 5.3 group password policy changes 7 30
Using Grep to Find a file 8 99
Using sort and uniq to pare down large syslog 6 55
UNIX Script. Send email if failure 8 37
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question