![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| compare files in two directories and output changed files to third directory | bkeep | Shell Programming and Scripting | 4 | 08-26-2009 07:58 AM |
| How to strip ^M at end of each files for all files found in current directory | bisip99 | Shell Programming and Scripting | 4 | 06-18-2009 05:08 PM |
| mget * (obtein files from current directory but not the files form sub-directories) | Peter321 | Shell Programming and Scripting | 0 | 03-12-2009 11:59 AM |
| how to extract files one by one from a directory and let some processing happen | saniya | Shell Programming and Scripting | 5 | 05-19-2008 10:02 AM |
| Processing files within a directory one by one | skyineyes | Shell Programming and Scripting | 1 | 07-16-2007 02:44 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
get all files from a directory and pass the files for processing
Hi All, I have a directory in which there will be several files. i want to get all the files and pass it to a piece of code for processing on the files. This is the piece of code which does the processing. Code:
tr "\n" "|" < (log file name) | tr "$" "\n" > output echo ' ' >>output while read line do sh ParseLog.sh "$line" echo $? done<output say i have a directory /user/resin_log , how to get all the files in this directory and pass one by one to this piece of code. Saw a similar query, but couldnt derive anything from that. Please Help. Thanks in advance. ---------- Post updated at 01:10 AM ---------- Previous update was at 12:01 AM ---------- done it with this piece of code. Thank you Code:
ls -lurt /user/resin_log | awk -F ' ' '{print $9}' > file_list
while read line
do
file_name=$line
tr "\n" "|" < (log file name) | tr "$" "\n" > output
echo ' ' >>output
while read line
do
sh ParseLog.sh "$line"
echo $?
done<output
fi
done <file_list
|
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|