Ask Your Question
0

How do I set the /bin/sh prompt?

asked 2018-01-19 17:50:22 -0500

Sijmen gravatar image

I want to set my shell (set to /bin/sh) prompt to a bare $. I tried this:

sh-4.4$ cat ~/.profile
export PS1='$ '

However, as can be seen, the prompt remains unchanged. It works when I source .profile:

sh-4.4$ . ~/.profile
$

I've also tried adding the export to .bash_profile and .bashrc, because who knows, but that didn't change the prompt either. From what I've read, /bin/sh is implemented by bash on Fedora, and invoked as such, it should (only) source .profile from the home directory.

What should I do to permanently set my prompt to $?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-01-19 18:18:48 -0500

sideburns gravatar image

Welcome to ask.fedora. You've got the right idea, but you're going about it the wrong way. I think that what you want is this:

$PS1='$ '
export $PS1

That should work.

edit flag offensive delete link more

Comments

Unfortunately, it does not. New shells still spawn with the 'full' prompt, with PS1 set to \s-\v\$

Sijmen gravatar imageSijmen ( 2018-01-19 18:22:19 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-01-19 17:50:22 -0500

Seen: 197 times

Last updated: Jan 19 '18