LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 03-18-2008, 01:44 PM   #1
jianelisj
LQ Newbie
 
Registered: Mar 2008
Posts: 18

Rep: Reputation: 0
Distinguish from the contents of a file which are the processes (NEWTHREAD)


FOR ANYONE WHO HAS THE SAME PROBLEM
Distinguish from the contents of a file which are the processes and print them


I have a file with name procs and the following content:

date
httpd
ps
tty
.....

how can i recognize which of these names are processes names and print only them

My solution is

for i in procs
do
if [ -p $i]
echo $i
done

but is does not work. I would appreciate any help.
 
Old 03-18-2008, 02:07 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
You *STILL* asking homework questions?? Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Distinguish from the contents of a file which are the processes and print them jianelisj Linux - Newbie 4 03-19-2008 09:24 AM
Make a Script Fle that opens A file and prints its contents (processes names) once jianelisj Linux - Newbie 4 03-17-2008 12:27 PM
[SOLVED] how to distinguish between a original file and a hard link bzlaskar Linux - Newbie 2 12-11-2007 08:58 AM
Bash remove part of a file based on contents of another file bhepdogg Programming 4 01-31-2007 03:13 PM
how to distinguish a file and a directory joeyBig Programming 2 10-01-2004 04:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration