View | Details | Raw Unified | Return to bug 30657
Collapse All | Expand All

(-)article.sgml (-19 / +19 lines)
Lines 93-100 Link Here
93
    </informalexample>
93
    </informalexample>
94
94
95
    <para>The first time you use adduser, it might ask for some
95
    <para>The first time you use adduser, it might ask for some
96
      defaults to save.  You might want to make the default shell csh
96
      defaults to save.  You might want to make the default shell <command>csh</command>
97
      instead of sh, if it suggests sh as the default.  Otherwise just
97
      instead of <command>sh</command>, if it suggests <command>sh</command> as the default.  Otherwise just
98
      press enter to accept each default.  These defaults are saved in
98
      press enter to accept each default.  These defaults are saved in
99
      <filename>/etc/adduser.conf</filename>, an editable file.</para>
99
      <filename>/etc/adduser.conf</filename>, an editable file.</para>
100
100
Lines 259-265 Link Here
259
      convenient).  You can create other aliases by editing
259
      convenient).  You can create other aliases by editing
260
      <filename>.cshrc</filename>.  You can make these aliases
260
      <filename>.cshrc</filename>.  You can make these aliases
261
      available to all users on the system by putting them in the
261
      available to all users on the system by putting them in the
262
      system-wide csh configuration file,
262
      system-wide <command>csh</command> configuration file,
263
      <filename>/etc/csh.cshrc</filename>.</para>
263
      <filename>/etc/csh.cshrc</filename>.</para>
264
  </sect1>
264
  </sect1>
265
265
Lines 877-883 Link Here
877
      are kept, <command>rehash</command>, and then put the following lines
877
      are kept, <command>rehash</command>, and then put the following lines
878
      in <filename>.cshrc</filename> in each user's home directory or
878
      in <filename>.cshrc</filename> in each user's home directory or
879
      (easier) in <filename>/etc/csh.cshrc</filename>, the
879
      (easier) in <filename>/etc/csh.cshrc</filename>, the
880
      system-wide csh start-up file:</para>
880
      system-wide <command>csh</command> start-up file:</para>
881
881
882
    <informalexample>
882
    <informalexample>
883
      <programlisting>setenv XKEYSYMDB /usr/X11R6/lib/X11/XKeysymDB
883
      <programlisting>setenv XKEYSYMDB /usr/X11R6/lib/X11/XKeysymDB
Lines 909-925 Link Here
909
      files: a series of commands to be run without your
909
      files: a series of commands to be run without your
910
      intervention.</para>
910
      intervention.</para>
911
911
912
    <para>Two shells come installed with FreeBSD: csh and sh.  csh is
912
    <para>Two shells come installed with FreeBSD: <command>csh</command> and <command>sh</command>.  <command>csh</command> is
913
      good for command-line work, but scripts should be written with
913
      good for command-line work, but scripts should be written with
914
      sh (or bash).  You can find out what shell you have by typing
914
      <command>sh</command> (or <command>bash</command>).  You can find out what shell you have by typing
915
      <command>echo $SHELL</command>.</para>
915
      <command>echo $SHELL</command>.</para>
916
916
917
    <para>The csh shell is okay, but tcsh does everything csh does and
917
    <para>The <command>csh</command> shell is okay, but <command>tcsh</command> does everything <command>csh</command> does and
918
      more.  It allows you to recall commands with the arrow keys
918
      more.  It allows you to recall commands with the arrow keys
919
      and edit them.  It has tab-key completion of filenames (csh uses
919
      and edit them.  It has tab-key completion of filenames (<command>csh</command> uses
920
      the escape key), and it lets you switch to the directory you
920
      the <keycap>Esc</keycap> key), and it lets you switch to the directory you
921
      were last in with <command>cd -</command>.  It's also much
921
      were last in with <command>cd -</command>.  It's also much
922
      easier to alter your prompt with tcsh.  It makes life a lot
922
      easier to alter your prompt with <command>tcsh</command>.  It makes life a lot
923
      easier.</para>
923
      easier.</para>
924
924
925
    <para>Here are the three steps for installing a new shell:</para>
925
    <para>Here are the three steps for installing a new shell:</para>
Lines 929-948 Link Here
929
	<para>Install the shell as a port or a package, just as you
929
	<para>Install the shell as a port or a package, just as you
930
	  would any other port or package.  Use
930
	  would any other port or package.  Use
931
	  <command>rehash</command> and <command>which tcsh</command>
931
	  <command>rehash</command> and <command>which tcsh</command>
932
	  (assuming you're installing tcsh) to make sure it got
932
	  (assuming you're installing <command>tcsh</command>) to make sure it got
933
	  installed.</para>
933
	  installed.</para>
934
      </step>
934
      </step>
935
935
936
      <step>
936
      <step>
937
	<para>As root, edit <filename>/etc/shells</filename>, adding a
937
	<para>As root, edit <filename>/etc/shells</filename>, adding a
938
	  line in the file for the new shell, in this case
938
	  line in the file for the new shell, in this case
939
	  /usr/local/bin/tcsh, and save the file.  (Some ports may do
939
	  <filename>/usr/local/bin/tcsh</filename>, and save the file.  (Some ports may do
940
	  this for you.)</para>
940
	  this for you.)</para>
941
      </step>
941
      </step>
942
942
943
      <step>
943
      <step>
944
	<para>Use the <command>chsh</command> command to change your
944
	<para>Use the <command>chsh</command> command to change your
945
	  shell to tcsh permanently, or type <command>tcsh</command>
945
	  shell to <command>tcsh</command> permanently, or type <command>tcsh</command>
946
	  at the prompt to change your shell without logging in
946
	  at the prompt to change your shell without logging in
947
	  again.</para>
947
	  again.</para>
948
      </step>
948
      </step>
Lines 950-976 Link Here
950
950
951
    <note>
951
    <note>
952
      <para>It can be dangerous to change root's shell to something
952
      <para>It can be dangerous to change root's shell to something
953
	other than sh or csh on early versions of FreeBSD and many
953
	other than <command>sh</command> or <command>csh</command> on early versions of FreeBSD and many
954
	other versions of Unix; you may not have a working shell when
954
	other versions of Unix; you may not have a working shell when
955
	the system puts you into single user mode.  The solution is to
955
	the system puts you into single user mode.  The solution is to
956
	use <command>su -m</command> to become root, which will give
956
	use <command>su -m</command> to become root, which will give
957
	you the tcsh as root, because the shell is part of the
957
	you the <command>tcsh</command> as root, because the shell is part of the
958
	environment.  You can make this permanent by adding it to your
958
	environment.  You can make this permanent by adding it to your
959
	<filename>.tcshrc</filename> file as an alias with
959
	<filename>.tcshrc</filename> file as an alias with
960
	<programlisting>alias su su -m.</programlisting></para>
960
	<programlisting>alias su su -m.</programlisting></para>
961
    </note>
961
    </note>
962
962
963
    <para>When tcsh starts up, it will read the
963
    <para>When <command>tcsh</command> starts up, it will read the
964
      <filename>/etc/csh.cshrc</filename> and
964
      <filename>/etc/csh.cshrc</filename> and
965
      <filename>/etc/csh.login</filename> files, as does csh.  It will
965
      <filename>/etc/csh.login</filename> files, as does <command>csh</command>.  It will
966
      also read the <filename>.login</filename> file in your home
966
      also read the <filename>.login</filename> file in your home
967
      directory and the <filename>.cshrc</filename> file as well,
967
      directory and the <filename>.cshrc</filename> file as well,
968
      unless you provide a <filename>.tcshrc</filename> file.  This
968
      unless you provide a <filename>.tcshrc</filename> file.  This
969
      you can do by simply copying <filename>.cshrc</filename> to
969
      you can do by simply copying <filename>.cshrc</filename> to
970
      <filename>.tcshrc</filename>.</para>
970
      <filename>.tcshrc</filename>.</para>
971
971
972
    <para>Now that you've installed tcsh, you can adjust your prompt.
972
    <para>Now that you've installed <command>tcsh</command>, you can adjust your prompt.
973
      You can find the details in the manual page for tcsh, but here
973
      You can find the details in the manual page for <command>tcsh</command>, but here
974
      is a line to put in your <filename>.tcshrc</filename> that will
974
      is a line to put in your <filename>.tcshrc</filename> that will
975
      tell you how many commands you have typed, what time it is, and
975
      tell you how many commands you have typed, what time it is, and
976
      what directory you are in.  It also produces a
976
      what directory you are in.  It also produces a

Return to bug 30657