in reply to Embedding perl in bash
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
|
|---|