Looping and conditional branching on the command line

I am piping STDOUT from commands such as ifconfig and dmesg through grep, sed and awk to get the information I need.

I need to now perform some looping and branching now and have been trying to figure out how to do this on the command line.

You may ask "Why the command line? - Why not put it into a script file?' I have a situation that the requirements put to me that I am not supposed to write any files to the system when gathering my information from the system.

Any help that you can provide or at least pointing me in the right direction would be greatly appreciated.

Thank you very much,

KG

as an example of looping from the command line may looks something like this (tested with korn shell):

$ for i in `ls -1`; do file $i; done

.. this uses the file command to show you the file type for each file on the working directory...

does this answer your question?

infierno - thank you for your reply...

I believe it gets me further down the road. Thank you for steering me in the right direction.

Thank you,

KG