[Tcsh] history for combined catch

H.Merijn Brand h.m.brand at xs4all.nl
Mon Feb 10 13:02:01 UTC 2020


On Sat, 8 Feb 2020 11:39:40 -0500, Christos Zoulas
<christos at zoulas.com> wrote:

> There is histlit for that... (to print the actual input line).

I know that one. I was wondering about the inconsistency between the
docs and the default expansion.

Reading the docs I would *not* expect the space

> christos
> 
> > On Jan 31, 2020, at 4:41 AM, H.Merijn Brand <h.m.brand at xs4all.nl>
> > wrote:
> > 
> > Signed PGP part
> > 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.  
>  [...]  
> >               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/20200210/0d888994/attachment.asc>


More information about the Tcsh mailing list