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

Re: [TCLUG:8923] SMB/scripting question



On Tue, 5 Oct 1999, Carl Wilhelm Soderstrom wrote:

> is 'q(shell command);' the syntax for executing a shell command in perl?

No, q means use the next character as the quote character. In this case, (
is begin quote and ) is end quote. This makes having a sheel script with
quotes in it not go wrong.

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

if [ -f filename ] in Bourne-compatible shells.


> I know how to check for the existence of a file in perl, but not how to
> execute a shell command;

Use backticks or the system() call.


-- Chris

  Christopher Reid Palmer : www.innerfireworks.com