Display contents of a file in the parent directory

Posted by Sharjeel Sayed on Stack Overflow See other posts from Stack Overflow or by Sharjeel Sayed
Published on 2010-03-21T05:28:59Z Indexed on 2010/03/21 5:31 UTC
Read the original article Hit count: 562

Filed under:
|
|
|
|

I have a command which lists Weblogic instances directories on a server.I want to display contents of a file in the parent directory of each directory listed.

An additional feature would be to display the name of the file in addition to displaying the contents

/usr/ucb/ps auwwx | grep weblogic | tr ' ' '\n' | grep security.policy | grep domain | awk -F'=' '{print $2}' | sed -e 's/weblogic.policy//' -e 's/security\///' | sort

The output of the above command looks like this

/opt/<some_directory>/<domain_name>/<app_name>/
/opt/<some_directory>/<domain_name>/<app_name>/

I want to cat a file somefile.cf in the directory

© Stack Overflow or respective owner

Related posts about sed

Related posts about bash