home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / linux / 7071 < prev    next >
Encoding:
Text File  |  1992-07-30  |  2.5 KB  |  76 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!boulder!hamlet!drew
  3. From: drew@hamlet.cs.colorado.edu (Drew Eckhardt)
  4. Subject: Re: New questions (was: Help a linux newcomer please)
  5. Message-ID: <1992Jul30.231400.17194@colorado.edu>
  6. Sender: news@colorado.edu (The Daily Planet)
  7. Nntp-Posting-Host: hamlet.cs.colorado.edu
  8. Organization: University of Colorado at Boulder
  9. References: <1992Jul30.213310.28841@zip.eecs.umich.edu>
  10. Date: Thu, 30 Jul 1992 23:14:00 GMT
  11. Lines: 63
  12.  
  13. In article <1992Jul30.213310.28841@zip.eecs.umich.edu> monkey@z.eecs.umich.edu (Xinbing Liu) writes:
  14. >Thanks to all who sent me email about my questions. Most are very helpful. A
  15. >few said all the answers were in FAQ.  I disagree.  I did read thru FAQ.  But
  16. >nowhere in FAQ mentions where to get the command 'ln' which is needed for the
  17. >mtools to work.  And I did not find in FAQ how to setup new accounts.
  18. >Anyway, now I've got mtools to work, and I can avoid the long and tedious
  19. >process of rawriting to floppies.  Now I have new questions:
  20. >
  21. >1. How do I set new path?  In unix I do "set path = ($path /mypath)", but
  22. >this does not seem to work here.
  23. >
  24. >2. How do I change the prompt?  Again in unix it's "set prompt="myprompt" ",
  25. >and this does not work either.
  26.  
  27. Answer : This is unix, or as close as we'll get without a USL lawsuit =8^)
  28.  
  29. You're just used to c-shell and its derivatives, 
  30. rather than Bourne shell (/bin/sh) and its kin.  Either get a csh for
  31. Linux (ie, tcsh) and do what you always do, or use the Bourne shell syntax,
  32. which is to say variable=value, and then export the result for environment
  33. variables (as oposed to shell variables).
  34.  
  35. Ie : 
  36.  
  37. PATH=${PATH}:/foo 
  38. export PATH
  39.  
  40. would add /foo to the default path.
  41.  
  42. Under Bourne shells, the prompts are set with 
  43. PS1 and PS2.
  44.  
  45. PS1 sets the "top level" promt, ie what you see at the command line, ie
  46. PS1=foo:
  47.  
  48. Will give me a prompt like 
  49.  
  50. foo:
  51.  
  52. PS2 sets what you see if you've done something to get yourself a second
  53. level prompt, ie not closing some sort of quote or control structure,
  54. or by using \ line continuation.
  55.  
  56. So, if PS1 = "foo: ", and PS2="bar: ", I could have a session that looks like
  57. this : 
  58.  
  59. foo: I=10  
  60. foo: while [ $I -gt 0 ]; do
  61. bar: echo $I 
  62. bar: I=`
  63. bar: expr $I - 1
  64. bar: `
  65. bar: done
  66. 10
  67. 9
  68. 8
  69. ...
  70. foo:
  71.  
  72. Whizzy Bourne-like  shells like gnu BASH (Bourne Again SHell), zsh, etc
  73. have special escapes that can be embedded in the path that expand to 
  74. the current path, execute some command, etc.  Read the manual 
  75. for your Bourne shell.
  76.