In other words, you want a perl version of using tr to change spaces to newlines.
ps -ef | grep appServerName | tr '[:space:]' '[\n*]'
Here is one way. This lends itself to extending the one-liner for processing the args in some way via @F.
ps -ef | perl -lane 'print join("\n", @F) if $F[-1] =~ /appServerName/'
Here is another.
ps -ef | perl -ne 'next unless /appServerName/; s/\s+/\n/g; print;'
No comments:
Post a Comment