Make a Script Fle that opens A file and prints its contents (processes names) once
i want to make a script file that opens a file with name procs (that exists in hom directory) and prints the processes that are written into it (the file procs consists of procceses names each one in a different line. If a process name is written twice then it must be print ony one time)
My solution is: for i in ./procs do echo $i | uniq done Is this solution correct? I would aprreciate any help |
Quote:
|
if it's ok to sort the contents of procs, do
Code:
for i in $(sort ./procs | uniq); do Code:
for i in $(<./procs); do |
Hmmm... <goes and looks> heh :\ I see what you mean.
Bots don't normally respond to replies though do they? With such a lot (and about one per day) all around the same somewhat narrow subject (sorting files, or through files, in bash) I could suspect homework here. <checks harder> BUSTED! These are homework questions. Was previously told that homework help is easier to get if he shows us what he's tried, since then, he's been posting some random code as well. |
Quote:
There's no point in regurgitating stuff for you if you're not taking anything in. Do your own homework. |
All times are GMT -5. The time now is 01:39 AM. |