Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I'm trying to take my bash output that has two parameters and pass them as arg0 & arg1 to a separate perl app. Looks something like: ./somescript.sh | awk ...
  1. #1
    Just Joined! jamsda's Avatar
    Join Date
    May 2006
    Posts
    5

    bash redirection question

    Hello,

    I'm trying to take my bash output that has two parameters and pass them as arg0 & arg1 to a separate perl app. Looks something like:

    ./somescript.sh | awk '{print $4 " " $7}'

    which produces:

    sometext someint

    I'm trying to pipe that output to my perl app's arg0 & arg1. I've tried some like this without success:

    ./somescript.sh | awk '{print $4 " " $7}' | ./perlscript.pl
    ./perlscript.pl | ./somescript.sh | awk '{print $4 " " $7}'

    Any idea's?

    Thanks,
    Jim

  2. #2
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    Try this:

    ./perlscript.pl $(./somescript.sh | awk '{print $4 " " $7}')

Posting Permissions

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