[linux-help] Re: Quick BASH/Perl Question
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
|
|