1834207 Members
2517 Online
110066 Solutions
New Discussion

Startup Scripts in 10.20

 
Bob Collins_3
Occasional Contributor

Startup Scripts in 10.20

I am looking for some direction in a custom startup script. In C-shell I have
a script that displays a prompt containing the [system name]\[current working
dir]. The script provides an updated prompt so that the pwd is always current.
Since the 10.20 upgrade and the new Posix shell was installed I have not been
able to come up with an equal. The best I can do is a static prompt current to
the working dir when the script executes.
If you know of a good resource for startup scripts I would appreciate it.

Regards,

Bob Collins
3 REPLIES 3
Robert Gamble_3
Regular Advisor

Re: Startup Scripts in 10.20

try this command in your .profile:

PS1=`hostname`":"'$PWD'"(""`whoami`"")> "

Re: Startup Scripts in 10.20

Try this sintaxis:

PS1=\<`uname -n`\>\$PWD\#


\$PWD is not evaluated by your current shell.

So, next shell find $PWD, and evaluate it.
Stacey Rippetoe_1
Occasional Advisor

Re: Startup Scripts in 10.20

Bob,
Since it's the csh your looking into, I would set up
an alias for cd, try this:
alias cd 'cd \!*;set prompt="[`hostname`]$cwd :"'
don't forget to exicute the cd command in the .cshrc
file so it will start as the prompt you want instead
of waiting for the cd command to be exicuted for the
first time.

Regards,
Stacey