Re: last character of the last line is a newline?

From: Janis Papanagnou (Janis_Papanagnou_at_hotmail.com)
Date: 05/19/05

  • Next message: Icarus Sparry: "Re: bash: $PS1 does not update with popd"
    Date: Thu, 19 May 2005 18:45:49 +0200
    
    

    juliag wrote:
    > snip
    >
    >>As the error message tells: {cat: command not found, there's no
    >
    > command
    >
    >>called "{cat". Insert a blank between { and cat.
    >>
    >>Janis
    >
    >
    > You are right! It works!
    >
    > Would it be possible for the routine to work without the rediection to
    > the screen. Would it be possible to redirect only to a file. Would it
    > means change the standard output?

    I don't understand what you are asking here. The program that you posted
    in your original posting did *not* _redirect_ anything to the screen;
    rather the behaviour of the programs involved (cat, echo) write their
    output to standard output (per default "the screen"). So you have to
    redirect the output explicitly to a file.

    In general, if your_program writes its output to standard out...

    # only to stdout
    your_program

    # only to your_file
    your_program >your_file

    # to stdout and to your_file
    your_program | tee your_file

    # suppress any stdout output
    your_program >/dev/null

    Substitute your_program by the compound command of your original posting:

    { # whatever was here...
    } >your_file

    Janis


  • Next message: Icarus Sparry: "Re: bash: $PS1 does not update with popd"

    Relevant Pages

    • Re: Start a program and get a hold of its STDOUT and STDIN?
      ... one would just redirect it on the command line: ... > was examples of getting STDIN or STDOUT but not both at ... I need this to be in real time (when the ...
      (comp.lang.perl.misc)
    • Re: Cron Daemon backup message too big
      ... What this command does is to concatenate stdout + errors and redirect ... Could I avoid this by terminating the command line instead like this: ... though you need a redirect to the file too like so: ...
      (Debian-User)
    • Re: Pipes and interprocess communication
      ... > command line argument) as a separate process. ... I redirect the stdout, ... > I then redirect the stdout of my program from the command line: ...
      (microsoft.public.vc.language)
    • Re: nohup
      ... i am not sure about this command. ... standard output or standard error - the '>outputfile' would redirect ... standard output to 'outputfile', and the '2>&1' would redirect standard ...
      (comp.unix.aix)
    • Re: How to determine the size of an output buffer
      ... your particular program's stdout is attached? ... stdin is associated with the keyboard, ... In this case I'm not allow to redirect the standard output. ...
      (comp.programming)