in reply to Error in converted shell script (was: Pls Help)

One solution:
To throw away any error output from grep that you don't want, change your last-but-one line to:
print `cat /etc/mail/aliases | grep $_ 2>/dev/null`;
Though you should probably find out whats actually causing the error, and fix that instead.

C.

Replies are listed 'Best First'.
Re: Re: Error in converted shell script (was: Pls Help)
by valdez (Monsignor) on Feb 14, 2003 at 13:38 UTC

    The script calls grep without arguments one time, because @filelist includes '/home/sites/$arg1/users'. A correct solution would be to call find with appropriate arguments: find <path> -type d -mindepth 1 -maxdepth 1. This command simplifies also the script, because you don't need to munge @filelist, and doesn't overload system issuing repeated deep scans of file system.

    Ciao, Valerio

Re: Re: Error in converted shell script (was: Pls Help)
by Anonymous Monk on Feb 14, 2003 at 13:55 UTC
    Thanks a lot. It's working properly. Before that i solved using shift(@store) statement. But your answer is exactly i needed. Best Regards