Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: alu on October 08, 2009, 03:23:53 AM
-
i can't find the file where i can customize my prompt tc@box:~$ ; i would like to add date and info about the weight of the directory where i am; i tried with .profile and bashrc but nothing appens when i restart xvesa. does someone knows how i can customize the prompt?
-
In TC, the PS1 variable is exported from .profile, which is a login file. What this means is that the variable is set once, and then .profile is never read after that. The result is that no changes to that file affect your environment unless you run the file again (or log out and log back in). So before starting x, run the command source .profile (shorthand: . .profile) (shorter-hand:. .pr<tab>)
Alternative: set PS1 in .ashrc, which is read for every ash shell (TC base doesn't use bash)
-
thanks mikshaw, that did it.
-
.... yes, i can change the prompt, but for some reason, date and time do not display:
#PS1='\d \t \u@\h:\w\$ '
do i do smthg wrong in the syntax?
-
Your PS1 works in Bash, but seems to not work in Ash. I haven't seen any documentation on this
-
Substitute `date` for \d
See here (http://www.oreillynet.com/linux/cmd/cmd.csp?path=d/date) and here (http://www.simplehelp.net/2008/12/18/the-linux-date-command/) for format options.
ex.
PS1='`date "+%D"` \u@\h:\w\$ '
10/09/09 tc@box:~$
-
thanks combo3, it works perfectly now