HP3000-L Archives

January 1999, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Ted Ashton <[log in to unmask]>
Date:
Thu, 14 Jan 1999 13:14:06 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (35 lines)
Thus it was written in the epistle of Chris Bartram,
> I'm writing some scripts that do printer functions; one of the problems I
> ran into is that occasionally (frequently actually) I need to execute MPE
> commands that contain "'"s (single quotes); as in #J'12345
>
> Having just started with Perl (and having yet to have picked up a book on
> it) I need to figure a way to get
>
> system("callci '$cicommand'");
>
> to work when cicommand contains a single-quote... Any help out Perl gurus?
>

As always, there's more than one way to do it.
  1) system("callci \"$cicommand\"");
and
  2) system('callci',$cicommand);

are two of those ways.  It appears that the POSIX shell strips single-quotes
differently than I would have expected.  The first of the above uses double
quotes and so solves that problem.  The second avoids the shell entirely and
as such should be a better choice in terms of security and efficiency.

Ted
--
Ted Ashton ([log in to unmask]), Info Serv, Southern Adventist University
          ==========================================================
Suppose we loosely define a religion as any discipline whose foundations
rest on an element of faith, irrespective of any element of reason which may
be present. Quantum mechanics for example would be a religion under this
definition. But mathematics would hold the unique position of being the only
branch of theology possessing a rigorous demonstration of the fact that it
should be so classified.
                                        -- De Sua, F. (1956)

ATOM RSS1 RSS2