I have never done much shell scripting, but I took a crack at it. Here's one way that seems to work:
#!/bin/bash INPUT="A string" func() { echo $INPUT | perl -e '$in=<STDIN>; $in=~s/string/thing/g; print $ +in' } RESULTS=$(func) echo $RESULTS
Output:
A thing
In reply to Re: Embedding perl in bash
by stevieb
in thread Embedding perl in bash
by wackattack
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |