Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I was hoping to run a perl script I had written from a bash script. Currently I am using command substitution: $(perl myPerlScript.pl "argument") The problem is the perl ...
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    4

    Perl script from bash

    Hi,

    I was hoping to run a perl script I had written from a bash script. Currently I am using command substitution:

    $(perl myPerlScript.pl "argument")

    The problem is the perl script requires a couple user interactions and when I run the bash script it won't seem to run it properly. Is there any way to do this?

    Thanks in advance.

  2. #2
    Linux Enthusiast likwid's Avatar
    Join Date
    Dec 2006
    Location
    MA
    Posts
    649
    The $() construct is for executing the code inside the parens, and substituting its output. You want to remove the $ and parens.

  3. #3
    Linux Enthusiast likwid's Avatar
    Join Date
    Dec 2006
    Location
    MA
    Posts
    649
    Well I think technically, $() means execute in a subshell, but most of the time when I use it, it's for getting a program's output into a variable.

  4. #4
    Just Joined!
    Join Date
    Sep 2007
    Posts
    4
    That was easy. I appreciate the clarification.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...