TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:8923] SMB/scripting question



Hello all:

> From: "Carl Wilhelm Soderstrom" <carls@agritech.com>
>
> is 'q(shell command);' the syntax for executing a shell command in perl?

No, q() is a cute way of doing single quotes.  Backticks (`) execute
shell commands in perl.  Check out:

    perl -e 'print `ls -l`'

It's a really slow 'ls'!  :-)

> alternatively, how do you check for the existence of a file or directory, in
> a shell script?

It depends on the shell, but the 'test' utility ("man test") has lots
of goodies.

John