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

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > December 2007 > input of pwd and ls -l in a file without using >>





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

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

2007-11-28, 7:36 am

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........ :-)
Barry Margolin

2007-11-28, 7:36 am

In article
<2dd3d68f-bd2c-4391-8e36-c8a978b3589f@e25g2000prg.googlegroups.com>,
nix <unixdomain@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
nix

2007-11-29, 1:36 am

On Nov 28, 3:48 pm, Barry Margolin <bar...@alum.mit.edu> wrote:
> In article
> <2dd3d68f-bd2c-4391-8e36-c8a978b35...@e25g2000prg.googlegroups.com>,
>
> nix <unixdom...@gmail.com> wrote:
>
>
> { 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[vbcol=seagreen]
Ed Morton

2007-11-29, 7:34 am



On 11/28/2007 11:09 PM, nix wrote:[vbcol=seagreen]
> On Nov 28, 3:48 pm, Barry Margolin <bar...@alum.mit.edu> wrote:
>
>
>
> 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.


nix

2007-12-03, 7:33 am

On Nov 29, 5:45 pm, Ed Morton <mor...@lsupcaemnt.com> wrote:
> On 11/28/2007 11:09 PM, nix wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
> 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. :-)
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com