[Tcsh] history for combined catch

H.Merijn Brand h.m.brand at xs4all.nl
Fri Jan 31 09:41:37 UTC 2020

I use >& >>& and |& on a regular basis. very regular :)

The docs refer to these like:

       > name
       >! name
       >& name
       >&! name
               The file name is used as standard output.  If the file does not
               exist  then it is created; if the file exists, it is truncated,
               its previous contents being lost.

               If the shell variable noclobber is set, then the file must  not
               exist  or  be  a  character  special  file (e.g., a terminal or
               `/dev/null') or an error results.  This helps prevent  acciden-
               tal  destruction  of  files.  In this case the `!' forms can be
               used to suppress this check.  If notempty is given  in  noclob-
               ber,  `>'  is  allowed  on  empty  files;  if  ask  is  set, an
               interacive confirmation is presented, rather than an error.

               The forms involving `&' route the diagnostic  output  into  the
               specified  file  as  well  as  the  standard  output.   name is
               expanded in the same way as `<' input filenames are.
       >> name
       >>& name
       >>! name
       >>&! name
               Like `>', but appends output to the end of name.  If the  shell
               variable noclobber is set, then it is an error for the file not
               to exist, unless one of the `!' forms is given.


       Diagnostic output may be directed through a pipe with the standard out-
       put.  Simply use the form `|&' rather than just `|'.

Note there is no space between the '>' or '|' and the '&'

But in the history, these are store separated by a space :(

% echo Foo >& /dev/null
% echo Foo |& cat > /dev/null
% echo Foo >>& /dev/null
% history 4
   502 01-31 10:37:20  echo Foo > & /dev/null
   503 01-31 10:37:33  echo Foo | & cat > /dev/null
   504 01-31 10:37:41  echo Foo >> & /dev/null
   505 01-31 10:37:46  history 4

Not that it causes problems, but I find it confusing and it makes
repeating commands and editing more complex. At least in my brain

Is there a (good) reason to add the unneeded space into the history?

H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.31      porting perl5 on HP-UX, AIX, and Linux
https://useplaintext.email  https://tux.nl  http://www.test-smoke.org
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://mailman.astron.com/pipermail/tcsh/attachments/20200131/5f9c39da/attachment.asc>

More information about the Tcsh mailing list