Python Forum
New to coding - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: New to coding (/thread-3429.html)



New to coding - allwinchris - May-23-2017

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



RE: New to coding - buran - May-23-2017

we are glad to help, but you must post your code and ask specific questions regarding problem you cannot resolve yourself.


RE: New to coding - allwinchris - May-23-2017

Sure but basically I am familiar with shell. so i am finding difficult to startup.


RE: New to coding - nilamo - May-31-2017

(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?