input of pwd and ls -l in a file without using >>

Hello,

How can I give input of pwd and ls -l in a file without using >> ?
The content of the file should be like this;
------------------------------------------------------------ ---------
/home/crbt/prac
-rw-rw-r-- 1 crbt crbt 0 Nov 28 12:59 lst
-rw-rw-r-- 1 crbt crbt 29 Nov 28 12:44 now
------------------------------------------------------------ ------------
Thanx........ :-)
Nix [ Mi, 28 November 2007 10:36 ] [ ID #1880447 ]

Re: input of pwd and ls -l in a file without using >>

In article
<2dd3d68f-bd2c-4391-8e36-c8a978b3589f [at] e25g2000prg.googlegroups.com>,
nix <unixdomain [at] gmail.com> wrote:

> Hello,
>
> How can I give input of pwd and ls -l in a file without using >> ?
> The content of the file should be like this;
> ------------------------------------------------------------ ---------
> /home/crbt/prac
> -rw-rw-r-- 1 crbt crbt 0 Nov 28 12:59 lst
> -rw-rw-r-- 1 crbt crbt 29 Nov 28 12:44 now
> ------------------------------------------------------------ ------------
> Thanx........ :-)

{ pwd; ls -l ; } > file
--
Barry Margolin
Arlington, MA
Barry Margolin [ Mi, 28 November 2007 11:48 ] [ ID #1880448 ]

Re: input of pwd and ls -l in a file without using >>

On Nov 28, 3:48 pm, Barry Margolin <bar... [at] alum.mit.edu> wrote:
> In article
> <2dd3d68f-bd2c-4391-8e36-c8a978b35... [at] e25g2000prg.googlegroups.com>,
>
> nix <unixdom... [at] gmail.com> wrote:
> > Hello,
>
> > How can I give input of pwd and ls -l in a file without using >> ?
> > The content of the file should be like this;
> > ------------------------------------------------------------ ---------
> > /home/crbt/prac
> > -rw-rw-r-- 1 crbt crbt 0 Nov 28 12:59 lst
> > -rw-rw-r-- 1 crbt crbt 29 Nov 28 12:44 now
> > ------------------------------------------------------------ ------------
> > Thanx........ :-)
>
> { pwd; ls -l ; } > file
> --
> Barry Margolin
> Arlington, MA

I've made a mistake.
The words "give" and "input" must be changed to "get" and "output"
so plz read the following
"How can I get the output of pwd and ls -l in a file without using
>> ?
Nix [ Do, 29 November 2007 06:09 ] [ ID #1881335 ]

Re: input of pwd and ls -l in a file without using >>

On 11/28/2007 11:09 PM, nix wrote:
> On Nov 28, 3:48 pm, Barry Margolin <bar... [at] alum.mit.edu> wrote:
>
>>In article
>><2dd3d68f-bd2c-4391-8e36-c8a978b35... [at] e25g2000prg.googlegroups.com>,
>>
>> nix <unixdom... [at] gmail.com> wrote:
>>
>>>Hello,
>>
>>>How can I give input of pwd and ls -l in a file without using >> ?
>>>The content of the file should be like this;
>>>--------------------------------------------------------- ------------
>>>/home/crbt/prac
>>>-rw-rw-r-- 1 crbt crbt 0 Nov 28 12:59 lst
>>>-rw-rw-r-- 1 crbt crbt 29 Nov 28 12:44 now
>>>--------------------------------------------------------- ---------------
>>>Thanx........ :-)
>>
>>{ pwd; ls -l ; } > file
>>--
>>Barry Margolin
>>Arlington, MA
>
>
> I've made a mistake.
> The words "give" and "input" must be changed to "get" and "output"
> so plz read the following
> "How can I get the output of pwd and ls -l in a file without using
>
>>>?
>>

That IS what we all assumed you meant. Did you try the solution Barry gave you?

Ed.
Ed Morton [ Do, 29 November 2007 13:45 ] [ ID #1881339 ]

Re: input of pwd and ls -l in a file without using >>

On Nov 29, 5:45 pm, Ed Morton <mor... [at] lsupcaemnt.com> wrote:
> On 11/28/2007 11:09 PM, nix wrote:
>
>
>
>
>
> > On Nov 28, 3:48 pm, Barry Margolin <bar... [at] alum.mit.edu> wrote:
>
> >>In article
> >><2dd3d68f-bd2c-4391-8e36-c8a978b35... [at] e25g2000prg.googlegroups.com>,
>
> >> nix <unixdom... [at] gmail.com> wrote:
>
> >>>Hello,
>
> >>>How can I give input of pwd and ls -l in a file without using >> ?
> >>>The content of the file should be like this;
> >>>--------------------------------------------------------- ------------
> >>>/home/crbt/prac
> >>>-rw-rw-r-- 1 crbt crbt 0 Nov 28 12:59 lst
> >>>-rw-rw-r-- 1 crbt crbt 29 Nov 28 12:44 now
> >>>--------------------------------------------------------- ---------------
> >>>Thanx........ :-)
>
> >>{ pwd; ls -l ; } > file
> >>--
> >>Barry Margolin
> >>Arlington, MA
>
> > I've made a mistake.
> > The words "give" and "input" must be changed to "get" and "output"
> > so plz read the following
> > "How can I get the output of pwd and ls -l in a file without using
>
> >>>?
>
> That IS what we all assumed you meant. Did you try the solution Barry gave you?
>
> Ed.- Hide quoted text -
>
> - Show quoted text -

Hello,
Yes, I've tried the solution and it's working.
Here is the solution Barry gave me;

{pwd;ls -l;} | some_command
Thank you very much. :-)
Nix [ Mo, 03 Dezember 2007 09:05 ] [ ID #1884284 ]
Linux » comp.unix.shell » input of pwd and ls -l in a file without using >>

Vorheriges Thema: [\D\S] vs. [^\d\s]
Nächstes Thema: Top 10 posters comp.unix.shell