Is there any way to source some other cshrc conditionally

Is there any way to source some other cshrc conditionally

am 11.10.2007 09:02:01 von parag_paul

I want to spawn a new shellm but the .cshrc should be diff,

Is that cs -rc

Please help me here

Re: Is there any way to source some other cshrc conditionally

am 11.10.2007 09:45:39 von Barry Margolin

In article <1192086121.021862.107550@o80g2000hse.googlegroups.com>,
"parag_paul@hotmail.com" wrote:

> I want to spawn a new shellm but the .cshrc should be diff,
>
> Is that cs -rc
>
> Please help me here

Start the shell with the -f option to prevent sourcing .cshrc, then use
"source filename" to source the one you want to use instead.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

Re: Is there any way to source some other cshrc conditionally

am 11.10.2007 14:33:49 von parag_paul

Also
is it possible to divide a .login section for interactive login for
sourcing only the alias files

The method you told was a known solution but I wanted to source only
the aliases

Re: Is there any way to source some other cshrc conditionally

am 11.10.2007 14:56:46 von Michael Tosch

parag_paul@hotmail.com wrote:
> Also
> is it possible to divide a .login section for interactive login for
> sourcing only the alias files
>
> The method you told was a known solution but I wanted to source only
> the aliases
>

# skip remaining setup if not an interactive shell
if ( ! $?prompt ) exit

# another method
/usr/bin/test -t 0
if ( ! $status ) then
echo "terminal attached - this is usually interactive"
endif


--
Michael Tosch @ hp : com

Re: Is there any way to source some other cshrc conditionally

am 12.10.2007 04:36:37 von Maxwell Lol

"parag_paul@hotmail.com" writes:

> Also
> is it possible to divide a .login section for interactive login for
> sourcing only the alias files

I use, in my ~/.cshrc file

if ( ! ( $?USER && $?prompt && $?TERM )) exit
# Only do this in interactive shells
if ( -f ~/.aliases ) source ~/.aliases


You don't want it in your .login file, because you want new
shell/windows to also define aliases.