list directory names feed to next command
hi all,
need help for writing a script. i have a bpm directory which has list of nodes. which are folder names. i want to list these names, save somewhere or directly pass the names one by one to next command and get the command out save in some file. i tried using ls, cut, grep etc....not successfully. any body mastered with awk or sed kindly can help me. e.g., Dir A having B,C,D,E etc. Get the B,C,D,E and pass to command one by one. n save the output to other file for further manipulations. Thanks... |
What do you mean by "pass to the command"?
Perhaps this: Code:
cd DirA |
Could use find for this. Use the -exec function
Quote:
|
here is the situation:
Directory A contains few directories. I want to get the name in a variable. Then there will put a for loop which will take those names one buy one n next command will be having the values of that variable which will generate output of memory management using that variable name. then I will store the output in file... I can do ls in a loop and store the name of directories... then in do part will put the other command and pass the listed directories name one by one to command n keep storing the output to a file. but somehow i think somewhere i m wrong n it won't work... P.S i'm a newbie... help plz |
Try to actually write some code - we're here to help, not do it for you.
You've got some good advice above; have a go at it and see what you can achieve. If you do this, you'll get lots more help if you need it. |
All times are GMT -5. The time now is 09:28 AM. |