2

I see that history doesn't display the body of loops. Is there a way to show them?

san: cd /tmp/test
san: touch abc
san: touch def
san: ls
abc   def
san: foreach file ( `ls` )
foreach? echo "File is $file"
foreach? end
File is abc
File is def
san: history | tail -6
   509  9:49    cd /tmp/test
   510  9:49    touch abc
   511  9:49    touch def
   512  9:49    ls
   513  9:49    foreach file ( `ls` )
   514  9:50    history | tail -6

History doesn't show the command echo "File is $file"

Update:

This is solved in new version, see Steve Parker's answer

> mkdir /tmp/test
> cd /tmp/test
> touch abc
> touch def
> ls
abc  def
> foreach file (`ls`)
foreach? echo "File is $file"
foreach? end
File is abc
File is def
> history | tail -6
    55  13:09   touch def
    56  13:09   ls
    57  13:09   foreach file ( `ls` )
    58  13:09   echo "File is $file"
    59  13:09   end
    60  13:09   history | tail -6
> tcsh --version
tcsh 6.18.01 (Astron) 2012-02-14 (x86_64-unknown-linux)
1
  • I am using exactly the same version 6.18.01, but history is not showing commands inside foreach
    – Shuman
    Aug 10, 2017 at 21:52

1 Answer 1

1

This ability came to tcsh at version 17.01, so my tcsh: propmt> tcsh --version tcsh 6.17.00 (Astron) 2009-07-10 (x86_64-unknown-linux) options wide,nls,dl,al,kan,sm,rh,color,filec

Does not allow this, but the very next version would support it.

https://github.com/tcsh-org/tcsh/compare/TCSH6_17_00...TCSH6_17_01 <- look under "Files changed" tab and look toward the bottom for line 5019 of the tcsh.man file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .