Output redirection to vi(ew)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • theo boots
    New Member
    • Nov 2007
    • 2

    Output redirection to vi(ew)

    Hello,

    I am programming a csh script which displays file-content and strings by using the vi-editor. The following program code works :

    ( cat /users/boots/filesForViewLog files/convert.logtxt ; \
    head -n 2 /users/boots/filesForViewLog files/path_convert.lo gtxt ; \
    echo nedit `pwd`/tools_*/convert.log "&" ; \
    echo vi `pwd`/tools_*/convert.log "&" ; \
    tail -n 2 /users/boots/filesForViewLog files/path_convert.lo gtxt ; \
    cat tools_*/convert.log ) | view -

    My problem starts when I want to check for the existence of the convert.log file as follows :

    ( cat /users/boots/filesForViewLog files/convert.logtxt ; \
    head -n 2 /users/boots/filesForViewLog files/path_convert.lo gtxt ; \
    set exists=`test -e `pwd`/tools_*/convert.log >& /dev/null` ;\)
    if ($status == 0) then
    echo nedit `pwd`/tools_*/convert.log "&" ;
    echo vi `pwd`/tools_*/convert.log "&" ;
    else ;
    echo "file exists not" ;
    endif ;
    tail -n 2 /users/boots/filesForViewLog files/path_convert.lo gtxt ; \
    cat tools_*/convert.log ) | view -

    This code seems to fail at the if-statement. I have copied the shell-transcript below this mail. Who can help me with this?

    Best Regards,

    Theo Boots

    >( cat /users/boots/filesForViewLog files/convert.logtxt ; \
    ? head -n 2 /users/boots/filesForViewLog files/path_convert.lo gtxt ; \
    ? set exists=`test -e `pwd`/tools_*/convert.log >& /dev/null` ;\
    ? if ($status == 0) then
    Too many ('s.
    > echo nedit `pwd`/tools_*/convert.log "&"
    nedit /workspaces/boots/s480a/sc14480a/romflow/480a5m_rom_vers ions/nl1_2/TSMCWT_e/tools_nl1_2/convert.log &
    > echo vi `pwd`/tools_*/convert.log "&"
    vi /workspaces/boots/s480a/sc14480a/romflow/480a5m_rom_vers ions/nl1_2/TSMCWT_e/tools_nl1_2/convert.log &
    >else
    else? echo "file exists not"
    else? endif
    >tail -n 2 /users/boots/filesForViewLog files/path_convert.lo gtxt ; \
    ? cat tools_*/convert.log ) | view -
    Too many )'s.
    >
  • theo boots
    New Member
    • Nov 2007
    • 2

    #2
    Hello

    Can anybody help me with this issue?

    Thanks in advance,

    Theo Boots

    Comment

    • Motoma
      Recognized Expert Specialist
      • Jan 2007
      • 3236

      #3
      I don't think that statement with nested `s is working the way you expect it.

      Comment

      Working...