|
|
| Next: so sick of vendors who advertise linux compatibil.. |
| Author |
Message |
Handover Phist External

Since: Nov 07, 2006 Posts: 367
|
Posted: Fri Dec 29, 2006 7:20 am Post subject: Find problem Archived from groups: alt>linux (more info?) |
|
|
Situation:
several .ra (realplayer) files to be converted to mp3, BladeEnc in in
$PATH
Command:
find . -name *ra -exec BladeEnc {};
returns:
find: paths must precede expression
Usage: find [-H] [-L] [-P] [path...] [expression]
hmmmmm....
--
He is no lawyer who cannot take two sides.
http://www.websterscafe.com |
|
| Back to top |
|
 |
Bit Twister External

Since: Dec 19, 2004 Posts: 1894
|
Posted: Fri Dec 29, 2006 7:20 am Post subject: Re: Find problem [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On Fri, 29 Dec 2006 07:20:44 GMT, Handover Phist wrote:
> Situation:
>
> several .ra (realplayer) files to be converted to mp3, BladeEnc in in
> $PATH
>
> Command:
>
> find . -name *ra -exec BladeEnc {};
>
> returns:
>
> find: paths must precede expression
> Usage: find [-H] [-L] [-P] [path...] [expression]
Search engine results:
Results 1 - 10 of about 16,000 for find name exec {} group:*linux*
(0.11 seconds)
--------- standard search tip follows ---------------------
Please bookmark the following, very large,
Frequently Asked Questions (faq) Search engine:
http://groups.google.com/advanced_group_search
find name exec {} in the first box
*linux* in Newsgroup box. You need to use the two
asterisks around linux, pick English
If you want/need more control over the first box search,
http://www.google.com/help/refinesearch.html
--------- end standard search tip text --------------------- |
|
| Back to top |
|
 |
Handover Phist External

Since: Nov 07, 2006 Posts: 367
|
Posted: Fri Dec 29, 2006 4:55 pm Post subject: Re: Find problem [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On 2006-12-29, Bit Twister <BitTwister.TakeThisOut@mouse-potato.com> wrote:
> On Fri, 29 Dec 2006 07:20:44 GMT, Handover Phist wrote:
>> Situation:
>>
>> several .ra (realplayer) files to be converted to mp3, BladeEnc in in
>> $PATH
>>
>> Command:
>>
>> find . -name *ra -exec BladeEnc {};
>>
>> returns:
>>
>> find: paths must precede expression
>> Usage: find [-H] [-L] [-P] [path...] [expression]
>
> Search engine results:
> Results 1 - 10 of about 16,000 for find name exec {} group:*linux*
> (0.11 seconds)
>
> --------- standard search tip follows ---------------------
>
> Please bookmark the following, very large,
> Frequently Asked Questions (faq) Search engine:
>
> http://groups.google.com/advanced_group_search
> find name exec {} in the first box
> *linux* in Newsgroup box. You need to use the two
> asterisks around linux, pick English
>
> If you want/need more control over the first box search,
> http://www.google.com/help/refinesearch.html
>
> --------- end standard search tip text ---------------------
I've managed to avoid you standard "Look at Google you n00b!" messages
for a good five years. There goes my uptime.
--
How should they answer?
-- Abigail Van Buren (Dear Abby) in reply to the question
"Why do Jews always answer a question with a question?"
http://www.websterscafe.com |
|
| Back to top |
|
 |
Handover Phist External

Since: Nov 07, 2006 Posts: 367
|
Posted: Fri Dec 29, 2006 5:50 pm Post subject: Re: Find problem [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Alrighty, after googling and looking at the man page I'm having
difficulty understanding why
find . -name "rc.conf" -exec chmod o+r '{}' \;
should work, according to google, or
find . -type f -exec file '{}' \;
works according to the man page, but on my box the -name option only
works without the dash (Debian Etch). Is this a new GNU thing with find
or something?
--
"Let's show this prehistoric bitch how we do things downtown!"
-- The Ghostbusters
http://www.websterscafe.com |
|
| Back to top |
|
 |
Bit Twister External

Since: Dec 19, 2004 Posts: 1894
|
Posted: Fri Dec 29, 2006 5:50 pm Post subject: Re: Find problem [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On Fri, 29 Dec 2006 17:50:45 GMT, Handover Phist wrote:
> Alrighty, after googling and looking at the man page I'm having
Yeah, at least you have that nasty syntax problem knocked down.
> difficulty understanding why
>
> find . -name "rc.conf" -exec chmod o+r '{}' \;
>
> should work, according to google, or
>
> find . -type f -exec file '{}' \;
>
> works according to the man page, but on my box the -name option only
> works without the dash (Debian Etch). Is this a new GNU thing with find
> or something?
I do not think it is a new GNU thing since I am running Mandriva linux 2007.
$ find . -name "*.txt" -exec echo ls '{}' \;
ls ./a1.txt
ls ./a2.txt
ls ./a3.txt
ls ./a4.txt
$ mkdir a5.txt
$ find . -type f -exec echo ls '{}' \;
ls ./a1.txt
ls ./a2.txt
ls ./a3.txt
ls ./a4.txt |
|
| Back to top |
|
 |
Handover Phist External

Since: Nov 07, 2006 Posts: 367
|
Posted: Fri Dec 29, 2006 7:45 pm Post subject: Re: Find problem [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On 2006-12-29, Bit Twister <BitTwister.RemoveThis@mouse-potato.com> wrote:
> On Fri, 29 Dec 2006 17:50:45 GMT, Handover Phist wrote:
>> Alrighty, after googling and looking at the man page I'm having
>
> Yeah, at least you have that nasty syntax problem knocked down.
>
>> difficulty understanding why
>>
>> find . -name "rc.conf" -exec chmod o+r '{}' \;
>>
>> should work, according to google, or
>>
>> find . -type f -exec file '{}' \;
>>
>> works according to the man page, but on my box the -name option only
>> works without the dash (Debian Etch). Is this a new GNU thing with find
>> or something?
>
> I do not think it is a new GNU thing since I am running Mandriva linux 2007.
>
>
> $ find . -name "*.txt" -exec echo ls '{}' \;
> ls ./a1.txt
> ls ./a2.txt
> ls ./a3.txt
> ls ./a4.txt
>
> $ mkdir a5.txt
>
> $ find . -type f -exec echo ls '{}' \;
> ls ./a1.txt
> ls ./a2.txt
> ls ./a3.txt
> ls ./a4.txt
jason@jason:~/Desktop/jooj/_Comedy$ find . -name *ra -exec mplayer -ao
pcm:file='{}.wav' '{}' \;
find: paths must precede expression
Usage: find [-H] [-L] [-P] [path...] [expression]
jason@jason:~/Desktop/jooj/_Comedy$
but:
jason@jason:~/Desktop/jooj/_Comedy$ find . name *ra -exec mplayer -ao
pcm:file='{}.wav' '{}' \;
works! The only difference being s/-name/name. Weirdness I tells ya! I
find Debian strange and confusing. Once Slackware defaults to a 2.6
kernel I'm going back.
--
MMM-MM!! So THIS is BIO-NEBULATION!
http://www.websterscafe.com |
|
| Back to top |
|
 |
Jerry Peters External

Since: Apr 06, 2004 Posts: 85
|
Posted: Fri Dec 29, 2006 9:55 pm Post subject: Re: Find problem [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Handover Phist <jason.TakeThisOut@nospamwebsterscafe.com> wrote:
> On 2006-12-29, Bit Twister <BitTwister.TakeThisOut@mouse-potato.com> wrote:
>> On Fri, 29 Dec 2006 17:50:45 GMT, Handover Phist wrote:
>>> Alrighty, after googling and looking at the man page I'm having
>>
>> Yeah, at least you have that nasty syntax problem knocked down.
>>
>>> difficulty understanding why
>>>
>>> find . -name "rc.conf" -exec chmod o+r '{}' \;
>>>
>>> should work, according to google, or
>>>
>>> find . -type f -exec file '{}' \;
>>>
>>> works according to the man page, but on my box the -name option only
>>> works without the dash (Debian Etch). Is this a new GNU thing with find
>>> or something?
>>
>> I do not think it is a new GNU thing since I am running Mandriva linux 2007.
>>
>>
>> $ find . -name "*.txt" -exec echo ls '{}' \;
>> ls ./a1.txt
>> ls ./a2.txt
>> ls ./a3.txt
>> ls ./a4.txt
>>
>> $ mkdir a5.txt
>>
>> $ find . -type f -exec echo ls '{}' \;
>> ls ./a1.txt
>> ls ./a2.txt
>> ls ./a3.txt
>> ls ./a4.txt
>
> jason@jason:~/Desktop/jooj/_Comedy$ find . -name *ra -exec mplayer -ao
*.ra is not escaped so the shell is trying to expand it. If there are
no matches the usual default is to leave it alone, if there are
matches, they're replacing *.ra on the command line; try preceding the
find with echo & see what the command line is being expanded to.
In general, if any args to find are shell metas it's necessary to
escape them, I would use find . -name '*ra' to prevent any shell
expansions.
Jerry
> pcm:file='{}.wav' '{}' \;
> find: paths must precede expression
> Usage: find [-H] [-L] [-P] [path...] [expression]
> jason@jason:~/Desktop/jooj/_Comedy$
>
> but:
>
> jason@jason:~/Desktop/jooj/_Comedy$ find . name *ra -exec mplayer -ao
> pcm:file='{}.wav' '{}' \;
>
> works! The only difference being s/-name/name. Weirdness I tells ya! I
> find Debian strange and confusing. Once Slackware defaults to a 2.6
> kernel I'm going back.
>
Why wait? I've been using current 2.6 kernels on Slack 10 for quite
some time (I have the Slack 11 cd's, now I need to upgrade).
Jerry |
|
| Back to top |
|
 |
Handover Phist External

Since: Nov 07, 2006 Posts: 367
|
Posted: Fri Dec 29, 2006 10:20 pm Post subject: Re: Find problem [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On 2006-12-29, Jerry Peters <jerry.RemoveThis@example.invalid> wrote:
>>
>> jason@jason:~/Desktop/jooj/_Comedy$ find . -name *ra -exec mplayer -ao
>
> *.ra is not escaped so the shell is trying to expand it. If there are
> no matches the usual default is to leave it alone, if there are
> matches, they're replacing *.ra on the command line; try preceding the
> find with echo & see what the command line is being expanded to.
> In general, if any args to find are shell metas it's necessary to
> escape them, I would use find . -name '*ra' to prevent any shell
> expansions.
>
> Jerry
Hi Jerry, thanks for the reply. I figured that out while cobbling a
script to convert .ra's to mp3s. This is where I'm at now:
#!/bin/bash
#
# Convert Realaudio files to mp3.
declare -a FILEARR
FILEARR=$(find . -name '*ra')
echo ${FILEARR[@]}
echo ${#FILEARR[*]}
sleep 5
This spits back an array of .ra files I can work on, but the file list
is in an array with a single item. Not very useful. I need to figure out
now how to assign each file name to it's own position in the array.
>> pcm:file='{}.wav' '{}' \;
>> find: paths must precede expression
>> Usage: find [-H] [-L] [-P] [path...] [expression]
>> jason@jason:~/Desktop/jooj/_Comedy$
>>
>> but:
>>
>> jason@jason:~/Desktop/jooj/_Comedy$ find . name *ra -exec mplayer -ao
>> pcm:file='{}.wav' '{}' \;
>>
>> works! The only difference being s/-name/name. Weirdness I tells ya! I
>> find Debian strange and confusing. Once Slackware defaults to a 2.6
>> kernel I'm going back.
>>
>
> Why wait? I've been using current 2.6 kernels on Slack 10 for quite
> some time (I have the Slack 11 cd's, now I need to upgrade).
>
> Jerry
I had been using 2.6 kernels on 10.2 when 11.0 came out. I did a full
format/reinstall because it was the easiest way to clean up after more
than a year of downloading, compiling, creating dotfiles and the like.
I'm a fan of Gnome though, and there was no easy way to put Gnome on
11.0. Gware didn't work and the other Gnome packages for Slack just tick
me off, so I switched to Debian Etch.
Nice distro, very easy to use and pretty. And broken. Apt did something
funky to gzip that I dont want to have to figure out, so the current
plan is just to sit on this box as is, since it's fully functional, the
go back to Slackware once the Gware folks have a working Gnome for it.
--
BOFH excuse #48:
bad ether in the cables
http://www.websterscafe.com |
|
| Back to top |
|
 |
noi External

Since: Oct 19, 2004 Posts: 614
|
Posted: Sat Dec 30, 2006 3:05 am Post subject: Re: Find problem [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On Fri, 29 Dec 2006 22:20:46 +0000, Handover Phist wrote this:
> On 2006-12-29, Jerry Peters <jerry DeleteThis @example.invalid> wrote:
>>>
>>> jason@jason:~/Desktop/jooj/_Comedy$ find . -name *ra -exec mplayer -ao
>>
>> *.ra is not escaped so the shell is trying to expand it. If there are no
>> matches the usual default is to leave it alone, if there are matches,
>> they're replacing *.ra on the command line; try preceding the find with
>> echo & see what the command line is being expanded to. In general, if
>> any args to find are shell metas it's necessary to escape them, I would
>> use find . -name '*ra' to prevent any shell expansions.
>>
>> Jerry
>
> Hi Jerry, thanks for the reply. I figured that out while cobbling a script
> to convert .ra's to mp3s. This is where I'm at now:
>
> #!/bin/bash
> #
> # Convert Realaudio files to mp3.
>
> declare -a FILEARR
> FILEARR=$(find . -name '*ra')
> echo ${FILEARR[@]}
> echo ${#FILEARR[*]}
> sleep 5
>
> This spits back an array of .ra files I can work on, but the file list is
> in an array with a single item. Not very useful. I need to figure out now
> how to assign each file name to it's own position in the array.
>
>
>>> pcm:file='{}.wav' '{}' \;
>>> find: paths must precede expression
>>> Usage: find [-H] [-L] [-P] [path...] [expression]
>>> jason@jason:~/Desktop/jooj/_Comedy$
>>>
>>> but:
>>>
>>> jason@jason:~/Desktop/jooj/_Comedy$ find . name *ra -exec mplayer -ao
>>> pcm:file='{}.wav' '{}' \;
>>>
>>> works! The only difference being s/-name/name. Weirdness I tells ya! I
>>> find Debian strange and confusing. Once Slackware defaults to a 2.6
>>> kernel I'm going back.
>>>
>>>
>> Why wait? I've been using current 2.6 kernels on Slack 10 for quite some
>> time (I have the Slack 11 cd's, now I need to upgrade).
>>
>> Jerry
>
> I had been using 2.6 kernels on 10.2 when 11.0 came out. I did a full
> format/reinstall because it was the easiest way to clean up after more
> than a year of downloading, compiling, creating dotfiles and the like. I'm
> a fan of Gnome though, and there was no easy way to put Gnome on 11.0.
> Gware didn't work and the other Gnome packages for Slack just tick me off,
> so I switched to Debian Etch.
>
> Nice distro, very easy to use and pretty. And broken. Apt did something
> funky to gzip that I dont want to have to figure out, so the current plan
> is just to sit on this box as is, since it's fully functional, the go back
> to Slackware once the Gware folks have a working Gnome for it.
I suggest use the find command to make a list of .ra files
then use a "for" loop in the script to parse the list of .ra files into
mp3 files. |
|
| Back to top |
|
 |
Handover Phist External

Since: Nov 07, 2006 Posts: 367
|
Posted: Sat Dec 30, 2006 6:20 am Post subject: Re: Find problem [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On 2006-12-30, noi <noi RemoveThis @siam.com> wrote:
>
> I suggest use the find command to make a list of .ra files
> then use a "for" loop in the script to parse the list of .ra files into
> mp3 files.
This is where I'm at, I have this script:
--------------------------------
#!/bin/bash
#
# Convert Realaudio files to mp3.
mplayer '$1' -ao pcm:file='$1.wav' \;
BladeEnc -del $1.wav
exit 0
--------------------------------
and I'm using this command:
for a in `find . -name '*ra'`; do ./doconvert.sh "$a"; done
but it's not working. All of the found files have whitespace and it's
trying to convert each word. I'll figure it out sooner or later.
--
Isn't it conceivable to you that an intelligent person could harbor
two opposing ideas in his mind?
-- Adlai Stevenson, to reporters
http://www.websterscafe.com |
|
| Back to top |
|
 |
Bit Twister External

Since: Dec 19, 2004 Posts: 1894
|
Posted: Sat Dec 30, 2006 6:20 am Post subject: Re: Find problem [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On Sat, 30 Dec 2006 06:20:47 GMT, Handover Phist wrote:
> but it's not working. All of the found files have whitespace and it's
> trying to convert each word. I'll figure it out sooner or later.
You might try changing your $1 to $* in doconvert.sh
You also may want consider changing apostrophe to double quote where
you use variables. |
|
| Back to top |
|
 |
Handover Phist External

Since: Nov 07, 2006 Posts: 367
|
Posted: Sat Dec 30, 2006 8:50 am Post subject: Re: Find problem [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On 2006-12-30, Bit Twister <BitTwister.RemoveThis@mouse-potato.com> wrote:
> On Sat, 30 Dec 2006 06:20:47 GMT, Handover Phist wrote:
>
>> but it's not working. All of the found files have whitespace and it's
>> trying to convert each word. I'll figure it out sooner or later.
>
> You might try changing your $1 to $* in doconvert.sh
>
> You also may want consider changing apostrophe to double quote where
> you use variables.
My good friend Binder Dundat could tell you what I've tried. I'm giving
in to doing it the long way I think.
Doh.
--
Confucious say:
man with head up ass have shitty outlook on life.
http://www.websterscafe.com |
|
| Back to top |
|
 |
Bit Twister External

Since: Dec 19, 2004 Posts: 1894
|
Posted: Sat Dec 30, 2006 8:50 am Post subject: Re: Find problem [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On Sat, 30 Dec 2006 08:50:47 GMT, Handover Phist wrote:
>
> My good friend Binder Dundat could tell you what I've tried. I'm giving
> in to doing it the long way I think.
just for fun, put the next two line as the first two lines of doconvert.sh
ls -al "$*"
exit
and see how it goes. |
|
| Back to top |
|
 |
noi External

Since: Oct 19, 2004 Posts: 614
|
Posted: Sat Dec 30, 2006 8:55 am Post subject: Re: Find problem [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On Sat, 30 Dec 2006 06:20:47 +0000, Handover Phist wrote this:
> On 2006-12-30, noi <noi DeleteThis @siam.com> wrote:
>>
>> I suggest use the find command to make a list of .ra files
>> then use a "for" loop in the script to parse the list of .ra files
>> into mp3 files.
>
> This is where I'm at, I have this script:
>
Yeah I know what you mean.
I'm not great at scripts so I add echo to debug until I get it right
> --------------------------------
#!/bin/bash
#
# Convert Realaudio files to mp3.
echo -e "'$1'"
mplayer "'$1'" -ao pcm:file="'$1'.wav'" \; BladeEnc -del "'$1'".wav
exit 0
> --------------------------------
>
Still a pain for other special characters.
I find adding sed for character replacement helped big time.
sed -e "s/\$/_/g" -e "s/\~/_/g"
I'm not familiar with awk so I use sed instead.
> and I'm using this command:
>
> for a in `find . -name '*ra'`; do ./doconvert.sh "$a"; done
>
> but it's not working. All of the found files have whitespace and it's
> trying to convert each word. I'll figure it out sooner or later. |
|
| Back to top |
|
 |
simplyrahul

Joined: Feb 08, 2009 Posts: 1
|
Posted: Sun Feb 08, 2009 11:06 pm Post subject: Resolution : [Login to view extended thread Info.] |
|
|
(Rahul Sinha)
Simply enclosing the wildcard in single quotes makes it work! e.g.
find . -name ‘*.*’ |
|
| Back to top |
|
 |
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|