[linux-help] Re: Quick BASH/Perl Question
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Oh, I guess I didn't understand your problem. You could just something
like a for loop to operate on *.log. What do you need to do - search for
the existence of ANY .log file(s)?
John
On Wed, 10 Jan 2001, Curtis Hawthorne wrote:
>
> That still gives me the same error message. In the
> directory, there are about 10 or so .log files in the
> directory, and I think that by saying *.log, the shell
> will expand it to list individually every file. Any
> other ideas?
>
> --- John Reinke <jmreinke@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> > On Wed, 10 Jan 2001, Curtis Hawthorne wrote:
> >
> > > First, in BASH, how do I test for the presence of
> > any
> > > .log (*.log) file in a directory? If I do "test
> > -a
> > > *.log" it says there's too many arguments.
> >
> > I always use an if contruct, although I guess it's
> > technically still test:
> >
> > if [ -f *.log ]; then
> > echo "File exists"
> > fi
> >
> > This tests if the file exists and is a regular file,
> > you can use -d to
> > test for a directory, etc...
> >
> > For a quicker reply, I'll let someone else answer
> > the other question,
> > since my perl is rusty at the moment.
> >
> >
> > > Second, in Perl what's the easiset way to grab the
> > > first letter of a string, preferably without
> > splitting
> > > the whole thing into a letter by letter array?
> > >
> > > Thanks!
> > >
> > > Curtis
> >
> >
> > -- This is the linux-help@xxxxxxxxx list. To
> > unsubscribe,
> > visit
> >
> http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - Share your holiday photos online!
> http://photos.yahoo.com/
>
> -- This is the linux-help@xxxxxxxxx list. To unsubscribe,
> visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi
>
-- This is the linux-help@xxxxxxxxx list. To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi
|
|