![]() |
|
|
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 |
| Passing the values to the secondary script when it invoked by primary script | venu_eie | UNIX for Advanced & Expert Users | 2 | 07-03-2008 08:10 AM |
| Passing the values to the secondary script when it invoked by primary script | venu_eie | Shell Programming and Scripting | 1 | 07-03-2008 07:16 AM |
| create a shell script that calls another script and and an awk script | magikminox | Shell Programming and Scripting | 0 | 06-26-2008 03:50 AM |
| help me in sending parameters from sqlplus script to unix shell script | Hara | Shell Programming and Scripting | 2 | 01-29-2008 03:31 PM |
| Shell Script: want to insert values in database when update script runs | ring | Shell Programming and Scripting | 1 | 10-25-2007 04:06 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Need help with script
for i in "/var/log/all/*"
do set -- $i for j in "$i/sudo.*" do cat $j | /home/dariley/sudo-filter.pl done done The result is the following error message: ./sudo-filter-invoker.sh: /bin/cat: arg list too long I want the script to go through all the log files on this log server and find the sudo entries which are then piped into a perl script. Please help, what am I missing? |
|
||||
|
Hi, i don't understand what you are using the two for loops for. If you try to traverse down recursively a directory, find can do this for you. If you use "while read" instead of for, you can pass the filenames one by one. Take this as an example: Code:
find /var/log/all -iname "sudo\.*" | while read file do cat "$file" | /home/dariley/sudo-filters.pl done HTH Chris |
|
||||
|
Chris,
thank you for the suggestion but I'm afraid that didn't work so well. It created about two thousand emails in two minutes ![]() The orginal statement that use to work when the filesystem was small: #!/bin/sh cat /var/log/all/*/sudo.* | \ /home/dariley/sudo-filter.pl I can get this to work if I specify each serverlog in the subdirectory: #!/bin/sh cat /var/log/all/watership/watership.current | \ /home/dariley/sudo-filter.pl but I want to make it so that as new server logs are added I don't have to edit the script. Any suggestions? Thanks. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|