bnghtz

prompt in csh

Nov 17th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. prompt in csh
  2.  
  3. set prompt="here comes the snake "
  4.  
  5. %/ - full path
  6. %~ - used path (follows the cd command)
  7. %. - relative path from ~
  8. %c - relative path from ~
  9. %M - $HOST (machine)
  10. %m - $HOST | cut -d. -f1 (The hostname up to the first .)
  11. %n - username
  12.  
  13. %? - return value of the last command (echo $?)
  14. %h - history number of the current command
  15. %\! - history number of the current command (can be replicated by using the !number command)
  16. %l - TTY
  17. %j - The number of jobs
  18.  
  19.  
  20. %t - time (hh:mmAM)
  21. %@ - time (hh:mmAM)
  22. %T - time (hh:mm)
  23. %p - full time (hh:mm:ssAM)
  24. %P - full time (hh:mm:ss)
  25. %Y - year yyyy
  26. %y - year yy
  27. %W - month
  28. %w - name of month (Jan, Feb..)
  29. %D - day
  30. %d - name of day
  31.  
  32. %B - bold, set
  33. %b - bold, unset
  34. %U - underline, set
  35. %u - underline, unset
  36. %S - standout mode, set
  37. %s - standout mode, unset
  38.  
  39.  
  40. %$ Expands the shell or environment variable name immediately after the `$'.
  41. %# `>' (or the first character of the promptchars shell variable) for normal users, `#' (or the second character of promptchars) for the supe? ruser.
  42. %{string%} Includes string as a literal escape sequence. It should be used only to change terminal attributes and should not move the cursor location. This cannot be the last sequence in prompt.
  43. %? The return code of the command executed just before the prompt.
  44. %R In prompt2, the status of the parser. In prompt3, the corrected string. In history, the history string.
  45.  
  46.  
  47. # time ~/folder
  48. set prompt="%U%T%u %. "
  49.  
  50. # user@host:~/folder
  51. set prompt="%n@%m:%c "
  52.  
  53. # user@host:~/folder >
  54. set prompt="%B%n@%m:%c >%b "
  55.  
  56. # user@host:~/folder 37>
  57. set prompt="%B%n@%m:%c %h>%b "
Advertisement
Add Comment
Please, Sign In to add comment