How to set prompt before starting csh?

How to set prompt before starting csh?

Post by Marti » Wed, 30 May 2001 04:48:01



Hi,

I can't figure out how to set a prompt before starting the new csh. My
problem is that I start csh from a script like this:

    #!/bin/sh
    prompt="My prompt>"
    csh

In this case csh does not recognize the Bourne shell variable prompt. I know
that I can set prompt in my .cshrc file but I'd like to avoid that. I want
my script to set the prompt.

Maybe there is a way to source another file which will set my prompt? How
can I start csh so that it sources another file? I tried the following and
it didn't work:

csh -Dprompt="My prompt"
csh -c "source mypromptfile"

Martin

 
 
 

How to set prompt before starting csh?

Post by Cyrille Lefevr » Wed, 30 May 2001 07:12:00



> In this case csh does not recognize the Bourne shell variable prompt. I know
> that I can set prompt in my .cshrc file but I'd like to avoid that. I want
> my script to set the prompt.

you can't since prompt is a variable local to the shell which cannot
be exported. to set the prompt, you'll have to do it where is it
supposed to be done, that is the .cshrc.

Quote:> csh -Dprompt="My prompt"

this sets the environment variable but not the variable local.

Quote:> csh -c "source mypromptfile"

this execute the command "source ...", then exit.
you can't do this for interractive shells.

Cyrille.
--


Supprimer "%no-spam" et ".invalid" pour me repondre. | about who it chooses
Remove "%no-spam" and ".invalid" to answer me back.  | to be friends with.

 
 
 

1. set prompt to "pwd" in csh for a Sun Solaris 5.6

Hello,

    I am trying to set the prompt to read the value of pwd.
I am using csh on a Sun Ultra 1, Solaris OS 5.6.
Further, I'd like to be able to have the prompt displayed
as the user logname-pwd.

For example,

ideasadm-home/mwk/script%

I think it would look something like prompt = but I'm not certain
of the syntax. Any help would be greatly appreciated. Thanks

--
George Vandyke

2. passwd and friends

3. how to set prompt in csh to display pwd ?

4. Linux swap partitions

5. Setting prompt on csh

6. preventing floppy from mounting as MSDOS (instead of VFAT)

7. csh: How set prompt to current directory

8. MySQL won't start, is this the fix?

9. how to set path (alwas updated) in prompt with csh ?

10. setting prompt in csh

11. Setting prompt in csh to currdir

12. csh prompt (csh newbie)

13. Set prompt; eeprom & set ignoreeof