Trouble might be that `ps ax` produces a screen-full or more, of lines of information, and sed is choking on it.
Here's something that seems to do the trick, but may not be guaranteed to work under all circumstances:
I do the command `ps ax` and dump it to a temporary file:
and now, use sed's s/
function to delete 'ncdbrun' followed by sed's r
function to insert the tempfile we just made:
echo 'ncTODAY...ncdbrun' | sed -e "s/ncTODAY/$TODAY/g" -e 's/ncdbrun//; r tempfile'
and then delete the tempfile. Also, you probably want to encode the name of the tempfile using `mktemp` or whatever, and create it somewhere safe (in /tmp) for a production system.
There's probably a better way to do this, but I don't know it, or at least at this time of day, I can't find it
so good luck!
Originally Posted by mamun2015
...thanks a lot,man...
Try this; copy and paste this into a console:
echo 'please help,man!!' | sed 's/^p/P/;s/,/ me, Wo/'