Re: Shell game? was Re: pmount could perhaps be of greater utility?

2019-05-08 Thread KHMan
On 5/9/2019 12:34 AM, David Wright wrote: On Wed 08 May 2019 at 14:08:03 (+0800), KHMan wrote: On Tue 07 May 2019 at 10:12:10 (+1000), David wrote: On Mon, 6 May 2019 at 23:53, Erik Christiansen wrote: On 06.05.19 09:03, Greg Wooledge wrote: On Sat, May 04, 2019 at 01:48:01PM +0200, Jonas Sme

Re: Shell game? was Re: pmount could perhaps be of greater utility?

2019-05-08 Thread David Wright
On Wed 08 May 2019 at 14:08:03 (+0800), KHMan wrote: > > On Tue 07 May 2019 at 10:12:10 (+1000), David wrote: > > > On Mon, 6 May 2019 at 23:53, Erik Christiansen wrote: > > > > On 06.05.19 09:03, Greg Wooledge wrote: > > > > > On Sat, May 04, 2019 at 01:48:01PM +0200, Jonas Smedegaard wrote: > [sn

Re: Shell game? was Re: pmount could perhaps be of greater utility?

2019-05-07 Thread KHMan
On Tue 07 May 2019 at 10:12:10 (+1000), David wrote: On Mon, 6 May 2019 at 23:53, Erik Christiansen wrote: > On 06.05.19 09:03, Greg Wooledge wrote: > > On Sat, May 04, 2019 at 01:48:01PM +0200, Jonas Smedegaard wrote: [snipped all] Hi Erik Maybe you would enjoy answering this question then? h

Shell game? was Re: pmount could perhaps be of greater utility?

2019-05-07 Thread David Wright
On Tue 07 May 2019 at 10:12:10 (+1000), David wrote: > On Mon, 6 May 2019 at 23:53, Erik Christiansen > wrote: > > On 06.05.19 09:03, Greg Wooledge wrote: > > > On Sat, May 04, 2019 at 01:48:01PM +0200, Jonas Smedegaard wrote: > > > > Quoting Erik Christiansen (2019-05-04 08:43:53) > > > > > >

Re: shell game

2002-12-08 Thread Frank Gevaerts
On Sun, Dec 08, 2002 at 12:31:30AM -0600, Michael Heironimus wrote: > On Sat, Dec 07, 2002 at 08:26:21PM +0100, Frank Gevaerts wrote: > > > find . -name '*.jpg' -print0 | xargs -r0 mpg123 > > > > Any special reason not to use -exec (except of course that xargs works > > with any input, while -ex

Re: shell game

2002-12-07 Thread Michael Heironimus
On Sat, Dec 07, 2002 at 08:26:21PM +0100, Frank Gevaerts wrote: > > find . -name '*.jpg' -print0 | xargs -r0 mpg123 > > Any special reason not to use -exec (except of course that xargs works > with any input, while -exec only with find (obviously)) I always use xargs instead of find -exec becau

Re: shell game

2002-12-07 Thread Shyamal Prasad
"Bob" == Bob Proulx <[EMAIL PROTECTED]> writes: Bob> A very slight danger here. If the first filename starts with Bob> a '-' then test will see this as an option instead of as a Bob> string and complain. This is why people prefix with a known Bob> character. Usually using an

Re: shell game

2002-12-07 Thread Bob Proulx
Shyamal Prasad <[EMAIL PROTECTED]> [2002-12-07 13:53:57 -0600]: > if [ "`find . -maxdepth 1 -name '*.jpg' -print`" != "" ] A very slight danger here. If the first filename starts with a '-' then test will see this as an option instead of as a string and complain. This is why people prefix with

Re: shell game

2002-12-07 Thread Herbert Xu
Michael Heironimus <[EMAIL PROTECTED]> wrote: > > There is a way that looks slightly better, but it's still ugly because > it relies on bash-specific options. Something like this should do it. > > #! /bin/bash > # Make globs that don't match expand to null string > shopt -s nullglob > if [ -n "$(

Re: shell game

2002-12-07 Thread Shyamal Prasad
"Drew" == Drew Cohan <[EMAIL PROTECTED]> writes: Drew> Hi, Using a bash shell script (/bin/sh), I need to know how Drew> to check to see if certain files exist in a directory, as Drew> in, "Are there any jpegs in this directory?". I've tried Drew> various things (like using -s

Re: shell game

2002-12-07 Thread Frank Gevaerts
On Sat, Dec 07, 2002 at 12:13:11PM -0700, Bob Proulx wrote: > Frank Gevaerts <[EMAIL PROTECTED]> [2002-12-07 19:58:00 +0100]: > > On Sat, Dec 07, 2002 at 11:47:54AM -0700, Bob Proulx wrote: > > > You are trying to find files in a directory. Therefore I recommend > > > you use the 'find' command. >

Re: shell game

2002-12-07 Thread Bob Proulx
Bob Proulx <[EMAIL PROTECTED]> [2002-12-07 12:13:11 -0700]: > > find . -name \*.jpg -exec mpg123 {} \; > I was only proposing the mpg123 as an example. I really don't know > what the OP wanted to do with it. You can tell what I was doing in the background while reading and responding to these mes

Re: shell game

2002-12-07 Thread Bob Proulx
Frank Gevaerts <[EMAIL PROTECTED]> [2002-12-07 19:58:00 +0100]: > On Sat, Dec 07, 2002 at 11:47:54AM -0700, Bob Proulx wrote: > > You are trying to find files in a directory. Therefore I recommend > > you use the 'find' command. > > [..contrived.example...] > > mp3playlist=$(find . -name '*.jpg'

Re: shell game

2002-12-07 Thread Frank Gevaerts
On Sat, Dec 07, 2002 at 11:47:54AM -0700, Bob Proulx wrote: > Drew Cohan <[EMAIL PROTECTED]> [2002-12-07 01:00:29 -0500]: > > > > Using a bash shell script (/bin/sh), I need to know how to check to see > > if certain files exist in a directory, as in, "Are there any jpegs in > > this directory?".

Re: shell game

2002-12-07 Thread Bob Proulx
Drew Cohan <[EMAIL PROTECTED]> [2002-12-07 01:00:29 -0500]: > > Using a bash shell script (/bin/sh), I need to know how to check to see > if certain files exist in a directory, as in, "Are there any jpegs in > this directory?". I've tried various things (like using -s, -f with > test and a do/for

Re: shell game

2002-12-07 Thread Gary Turner
Gary Turner wrote: >Drew Cohan wrote: >>Using a bash shell script (/bin/sh), I need to know how to check to see >>if certain files exist in a directory, as in, "Are there any jpegs in >>this directory?". > >Try > > ls *.jpg > /dev/null 2>&1 # tested command--output is >

Re: shell game

2002-12-06 Thread Michael Heironimus
On Sat, Dec 07, 2002 at 01:45:45AM -0500, Travis Crump wrote: > From the there has got to be a better way department: > > ls /opt/images/*.jpg > /dev/null 2>&1 && echo there are jpegs There is a way that looks slightly better, but it's still ugly because it relies on bash-specific options. Someth

Re: shell game

2002-12-06 Thread Gary Turner
Drew Cohan wrote: >Hi, > >Using a bash shell script (/bin/sh), I need to know how to check to see >if certain files exist in a directory, as in, "Are there any jpegs in >this directory?". I've tried various things (like using -s, -f with >test and a do/for loop) but nothing seems to work right.

Re: shell game

2002-12-06 Thread Lloyd Zusman
Travis Crump <[EMAIL PROTECTED]> writes: > Drew Cohan wrote: >> Hi, >> Using a bash shell script (/bin/sh), I need to know how to check to see >> if certain files exist in a directory, as in, "Are there any jpegs in >> this directory?". I've tried various things (like using -s, -f with >> test an

Re: shell game

2002-12-06 Thread Travis Crump
Drew Cohan wrote: Hi, Using a bash shell script (/bin/sh), I need to know how to check to see if certain files exist in a directory, as in, "Are there any jpegs in this directory?". I've tried various things (like using -s, -f with test and a do/for loop) but nothing seems to work right. The cl

shell game

2002-12-06 Thread Drew Cohan
Hi, Using a bash shell script (/bin/sh), I need to know how to check to see if certain files exist in a directory, as in, "Are there any jpegs in this directory?". I've tried various things (like using -s, -f with test and a do/for loop) but nothing seems to work right. The closest I can come is