Python Forum

Full Version: New to coding
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am new to python, if someones help or guide will be the great thankful.

Need to read file which has content like (aaa,bbb,ccc,ddd,.....) this may change everytime.

Read first column (aaa) and grep with the process ps -ef | grep -i aaa. it will give 4 lines. Get the out put of 4th line 8th column.

out put should be

Example:
aaa 11111 (8th column)
bbb 22222
ccc  33333

my code here
we are glad to help, but you must post your code and ask specific questions regarding problem you cannot resolve yourself.
Sure but basically I am familiar with shell. so i am finding difficult to startup.
(May-23-2017, 10:31 AM)allwinchris Wrote: [ -> ]ps -ef | grep -i aaa

...

out put should be

Example:
aaa 11111 (8th column)
bbb 22222
ccc  33333
Why would that be the output? Wouldn't grep strip out all but the first line?