From: Jerome Robertson on
I want to execute the File command on every file in /etc/sysconfig and
record the output in a file named sysconfig.find

Here is what I tried that didn't work:

find /etc/sysconfig -exec file {} /home/JR/sysconfig.find \; 2>/dev/null

I can't see why this command won't work.
From: SM on
2010-03-19, Jerome Robertson skribis:
> I want to execute the File command on every file in /etc/sysconfig and
> record the output in a file named sysconfig.find
>
> Here is what I tried that didn't work:
>
> find /etc/sysconfig -exec file {} /home/JR/sysconfig.find \; 2>/dev/null
>
> I can't see why this command won't work.

I usually do it via xargs:

find /etc/sysconfig -type f -print0 | xargs -0 file > /home/JR/sysconfig.find

--
kasmra
:wq
From: Florian Diesch on
Jerome Robertson <consimgamer(a)earthlink.net> writes:

> I want to execute the File command on every file in /etc/sysconfig and
> record the output in a file named sysconfig.find
>
> Here is what I tried that didn't work:
>
> find /etc/sysconfig -exec file {} /home/JR/sysconfig.find \; 2>/dev/null

That doesn't write any output in /home/JR/sysconfig.find but calls file
on the found file and /home/JR/sysconfig.find

Try
find /etc/sysconfig -exec file {} \; > /home/JR/sysconfig.find



Florian
--
<http://www.florian-diesch.de/software/shell-scripts/>