PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > find can't redirect my output to a file
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

find can't redirect my output to a file

Réponse
 
LinkBack Outils de la discussion
Vieux 05/11/2007, 17h39   #1
cozzmo1@hotmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut find can't redirect my output to a file


$ 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

  Réponse avec citation
Vieux 05/11/2007, 18h33   #2
Cyrus Kriticos
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find can't redirect my output to a file

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.
  Réponse avec citation
Vieux 05/11/2007, 18h38   #3
Michael Tosch
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find can't redirect my output to a file

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
  Réponse avec citation
Vieux 07/11/2007, 12h36   #4
cozzmo1@hotmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find can't redirect my output to a file

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
------

  Réponse avec citation
Vieux 07/11/2007, 14h12   #5
Scott McMillan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find can't redirect my output to a file

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
  Réponse avec citation
Vieux 07/11/2007, 14h18   #6
Cameron Laird
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find can't redirect my output to a file

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

  Réponse avec citation
Vieux 07/11/2007, 15h26   #7
Bill Marcum
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find can't redirect my output to a file

["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

  Réponse avec citation
Vieux 08/11/2007, 18h15   #8
cozzmo1@hotmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: find can't redirect my output to a file

-------
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



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h37.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,14874 seconds with 16 queries