|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
$ find /* -name "*assw*" -print 2> /dev/null With the above command, how would I redirect the output to a file? I tried these unsuccessfully $ find /* -name "*assw*" -print 2> /dev/null >> file1 !(no output) $ find /* -name "*assw*" -print 2> /dev/null | tee file1 !(no output) thanks, Crzzy1 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
cozzmo1@hotmail.com wrote:
> $ find /* -name "*assw*" -print 2> /dev/null > > With the above command, how would I redirect the output to a file? > > I tried these unsuccessfully > $ find /* -name "*assw*" -print 2> /dev/null >> file1 !(no > output) > $ find /* -name "*assw*" -print 2> /dev/null | tee file1 !(no > output) Which OS? try: $ find / -name "*assw*" -print >/tmp/file1 Are there any errors beside "Permission denied"? -- Best regards | Be nice to America or they'll bring democracy to Cyrus | your country. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
cozzmo1@hotmail.com wrote:
> $ find /* -name "*assw*" -print 2> /dev/null > > With the above command, how would I redirect the output to a file? > > I tried these unsuccessfully > $ find /* -name "*assw*" -print 2> /dev/null >> file1 !(no > output) > $ find /* -name "*assw*" -print 2> /dev/null | tee file1 !(no > output) > > thanks, > Crzzy1 > Because it does not find anything that matches "*assw*"? Then it will create an empty file1 or append nothing. Or it dies with "too many arguments" because /* has too many matches? The 2>/dev/null suppresses the error message. Try find / -print 2> /dev/null | tee file1 -- Michael Tosch @ hp : com |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Nov 5, 1:38 pm, Michael Tosch <eed...@NO.eed.SPAM.ericsson.PLS.se>
wrote: > cozz...@hotmail.com wrote: > > $ find /* -name "*assw*" -print 2> /dev/null > > > With the above command, how would I redirect the output to a file? > > > I tried these unsuccessfully > > $ find /* -name "*assw*" -print 2> /dev/null >> file1 !(no > > output) > > $ find /* -name "*assw*" -print 2> /dev/null | tee file1 !(no > > output) > > > thanks, > >Crzzy1 > > Because it does not find anything that matches "*assw*"? > Then it will create an empty file1 or append nothing. > > Or it dies with "too many arguments" because /* has too many > matches? The 2>/dev/null suppresses the error message. > > Try > > find / -print 2> /dev/null | tee file1 > > -- > Michael Tosch @ hp : com --------- I am sorry for not being more clear. find /* -name "*assw*" -print 2> /dev/null The above gives lots of output, but somehow I can't redirect it to a file. the below methods don't work, and file1 remains empty, the "tee" option gives no output either. $ find /* -name "*assw*" -print 2> /dev/null >> file1 $ find /* -name "*assw*" -print 2> /dev/null | tee file1 Thanks, Crzzy1 ------ |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On Wed, 07 Nov 2007 04:36:04 -0800, cozzmo1@hotmail.com wrote:
>On Nov 5, 1:38 pm, Michael Tosch <eed...@NO.eed.SPAM.ericsson.PLS.se> >wrote: >> cozz...@hotmail.com wrote: <snip> > >find /* -name "*assw*" -print 2> /dev/null > >The above gives lots of output, but somehow I can't redirect it to a >file. >the below methods don't work, and file1 remains empty, the "tee" >option gives no output either. > >$ find /* -name "*assw*" -print 2> /dev/null >> file1 > $ find /* -name "*assw*" -print 2> /dev/null | tee file1 > >Thanks, >Crzzy1 >------ What OS/find are you using? Your first example works fine for me using GNU find 4.2.31 in Slackware and the find in SCO Openserver. Scott McMillan |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
In article <1194438964.279834.134210@57g2000hsv.googlegroups. com>,
<cozzmo1@hotmail.com> wrote: >On Nov 5, 1:38 pm, Michael Tosch <eed...@NO.eed.SPAM.ericsson.PLS.se> >wrote: >> cozz...@hotmail.com wrote: >> > $ find /* -name "*assw*" -print 2> /dev/null >> >> > With the above command, how would I redirect the output to a file? >> >> > I tried these unsuccessfully >> > $ find /* -name "*assw*" -print 2> /dev/null >> file1 !(no >> > output) >> > $ find /* -name "*assw*" -print 2> /dev/null | tee file1 !(no >> > output) >> >> > thanks, >> >Crzzy1 >> >> Because it does not find anything that matches "*assw*"? >> Then it will create an empty file1 or append nothing. >> >> Or it dies with "too many arguments" because /* has too many >> matches? The 2>/dev/null suppresses the error message. >> >> Try >> >> find / -print 2> /dev/null | tee file1 >> >> -- >> Michael Tosch @ hp : com > >--------- > >I am sorry for not being more clear. > >find /* -name "*assw*" -print 2> /dev/null > >The above gives lots of output, but somehow I can't redirect it to a >file. >the below methods don't work, and file1 remains empty, the "tee" >option gives no output either. > >$ find /* -name "*assw*" -print 2> /dev/null >> file1 > $ find /* -name "*assw*" -print 2> /dev/null | tee file1 |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
["Followup-To:" header set to comp.unix.shell.]
> > I am sorry for not being more clear. > > find /* -name "*assw*" -print 2> /dev/null > > The above gives lots of output, but somehow I can't redirect it to a > file. > the below methods don't work, and file1 remains empty, the "tee" > option gives no output either. > > $ find /* -name "*assw*" -print 2> /dev/null >> file1 > $ find /* -name "*assw*" -print 2> /dev/null | tee file1 > Are you using csh or tcsh? If so, try find /* -name "*assw*" -print >& file1 |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
-------
I am using bash, I can do csh, but with either shell.. That works more or less, but without the "2> /dev/null" then the output has all the errors. (Below) and as long as I am redirecting the errors to "/dev/null" I can't seem to also redirect them to a file. host01% find /* -name "*assw*" -print >& file1 host01% more file1 find: cannot read dir /apps/lost+found: Permission denied find: cannot read dir /apps/Spectrum/lib/SDPM: Permission denied find: cannot read dir /apps/Spectrum/.ssh: Permission denied <snip> ------- On Nov 7, 10:26 am, Bill Marcum <marcumb...@bellsouth.net> wrote: > ["Followup-To:" header set to comp.unix.shell.] > > > I am sorry for not being more clear. > > > find /* -name "*assw*" -print 2> /dev/null > > > The above gives lots of output, but somehow I can'tredirectit to a > > file. > > the below methods don't work, and file1 remains empty, the "tee" > > option gives no output either. > > > $ find /* -name "*assw*" -print 2> /dev/null >> file1 > > $ find /* -name "*assw*" -print 2> /dev/null | tee file1 > > Are you using csh or tcsh? If so, try > find /* -name "*assw*" -print >& file1 |
|
![]() |
| Outils de la discussion | |
|
|