Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

My guess is that perl is correct about there not being a file Script1.pl in your directory. Possible causes for this are:

  • The current directory is not what you think it is. Print out the current directory before you start perl, maybe by doing cwd; before you launch Perl.
  • The file looks like it has the name Script1.pl but really it doesn't. Maybe it is called script1.pl (note the lower-case "s"), or Scriptl.pl (note the letter ell instead of the digit one) or something like that.

But without knowing the setup, it's hard to tell. In my shell scripts, I always ensure that the current working directory is set to something sane by doing:

BASE=$(cd $(dirname $0);pwd)

This sets the shell variable $BASE to the directory where the script resides in. All other executions are then done relative to $BASE - in your case, I would use:

exec perl -w "$BASE/Script1.pl" "$@"

to launch the Perl script - maybe your stanza is better as it will preserve quotes - on my system, I don't have to fight with arguments with embedded whitespace.


In reply to Re: execute perl script frm shell script by Corion
in thread execute perl script frm shell script by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-03-28 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found