Re: last character of the last line is a newline?
From: Janis Papanagnou (Janis_Papanagnou_at_hotmail.com)
Date: 05/19/05
- Previous message: linq936_at_hotmail.com: "bash: $PS1 does not update with popd"
- In reply to: juliag: "Re: last character of the last line is a newline?"
- Next in thread: juliag: "Re: last character of the last line is a newline?"
- Reply: juliag: "Re: last character of the last line is a newline?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: linq936_at_hotmail.com: "bash: $PS1 does not update with popd"
- In reply to: juliag: "Re: last character of the last line is a newline?"
- Next in thread: juliag: "Re: last character of the last line is a newline?"
- Reply: juliag: "Re: last character of the last line is a newline?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|