[Prev][Next][Index][Thread]
Re: How to do this in .cshrc file?
On Tue, 5 Apr 1994 15:33:59 -0400,
Kevin Weinrich <kbw_a@xxxxxxxxxxxxxxxxxx> wrote:
>Reply-to: Kevin Weinrich <kbw_a@xxxxxxxxxxxxxxxxxx>
>Followup-To: poster
>
>I have the following lines in my Sun's .cshrc file, and they
>work great to change the prompt to the machine-name in all caps,
>followd by the current directory, followed by the command-line #:
> set thismachine=`hostname | sed 's/\..*//' | tr 'a-z' 'A-Z'`
> alias cd 'cd \!*; set prompt="$thismachine`pwd`[\\!] "'
>but when I try the same thing on my Alpha (OSF 1.3), it chokes on the
>"set" line with "variable syntax". I can't get it to do even:
> set thismachine=`hostname`
>
>So, is there a way to set a variable to the output of a command in
>a .cshrc in OSF?
>
>I don't want to just "set thismachine=rover", because then I have to
>have a different .cshrc file for every machine.
>
>Thanks for any help,
>Kevin
It works fine under 2.0 (just upgraded yesterday.. what a mess..). You
also might want to consider tcsh. Tcsh does stuff of this sort, and
it buys you a whole lot more -- like command line editing, context
sensative file, environment varibable, machine name, etc completion,
watch logs, and much more..
Also, you might want to to try using setenv and see what happens.
Good luck,
Drew
##############################################################################
# Andrew Gallatin, System Administrator #
# Institute of Statistics and Decision Sciences #
# Box 90251, Duke University, Durham, NC 27708-0251 #
# email: gallatin@xxxxxxxxxxxxx #
##############################################################################
References: