Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8968515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:27:55+00:00 2026-06-15T17:27:55+00:00

I’m having a heck of a time standardizing my prompts across the different shells

  • 0

I’m having a heck of a time standardizing my prompts across the different shells I have installed for cygwin.

Installed shells:

  1. bash (default login shell)
  2. sh
  3. csh (tcsh, actually)
  4. ksh
  5. zsh

My prompt is standardized across bash, csh, and zsh, but I can’t get sh and ksh on board.

The prompt I’m looking to use across all shells is similar to the following:

20121216 15:18:04 [shell]   # date and time in yellow, shell in red
user@hostname pwd           # user@host in green, pwd in yellow
$                           # white

I’ve got it set the way I want it for bash with the following line in /etc/profile:

PS1="\[\e]0;\w\a\]\n\[\e[33m\]\D{%Y%m%d %H:%M:%S} \[\e[31m\][bash]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ "

And I’ve got it set for csh with the following line in .tcshrc:

set prompt="\n%{\033[33m%}%Y%W%D %P %{\033[31m%}[csh]\n%{\033[32m%}%n@%M %{\033[33m%}%~\n%{\033[0m%}$ "

And I’ve got it set for zsh with the following lines in .zshrc:

PROMPT="
%{$fg[yellow]%}%D{%Y%m%d} %* %{$fg[red]%}[zsh]%{$reset_color%}
%{$fg[green]%}%n@%m %{$reset_color%}%{$fg[yellow]%}%~%{$reset_color%}
$ "

But I can’t seem to set a default prompt for sh or ksh anywhere. I can open both of them and manually set PS1="$ ", but I cannot for the life of me get it to set automatically. The sh prompt looks identical to the bash prompt, and the ksh prompt is gibberish (bc it doesn’t like the syntax of PS1 that it’s inheriting from bash, I assume).

Things I’ve tried unsuccessfully:

  • setting PS1 in /etc/profile (in a case statement reading the shell
    name from echo $0)
  • setting PS1 in .kshrc
  • setting PS1 in .shrc
  • setting PS1 in .sh_profile
  • setting PS1 in .profile

It seems that cygwin just doesn’t execute the files listed above when I launch one of those shells. Note that I only ever launch those shells from within bash.

Any ideas? (Sorry for the book, I’m just trying to be thorough.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:27:55+00:00Added an answer on June 15, 2026 at 5:27 pm

    The official Korn shell ksh93 will read /etc/profile and ~/.profile on login, in that order.

    If ksh is not acting as a login shell it will try to read the file referred to by $ENV, or $HOME/.kshrc if ENV is not set.

    Older versions (sun’s ksh88 in particular) suffered from a chicken and egg situation because you could only set ENV in ~/.profile, but then you still had to source the file yourself with . $ENV.

    Note that ENV and PS1 have to be exported in order to be picked up by ksh instances spawned after login (say, from screen or tmux).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.