Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a script in a shell pipeline

Status
Not open for further replies.

PSD

Instructor
Apr 25, 2000
392
0
0
GB
Hi guys,

I have a script which I would like to run as a shell pipeline, so I copied it all into one line and it does not work.

su - root -c "echo /:${PATH}" | tr ':' '\n' | while read DIR ; do ; DIR=${DIR:-$(pwd)} ; print "Checking ${DIR}"; while [[ -d ${DIR} ]]; do; [[ "$(ls -ld ${DIR})" = @(d???????w? *) ]] && print " WARNING ${DIR} is world writable" || print " ${DIR} is not world writable"; [[ "$(ls -ld ${DIR})" = @(d????w???? *) ]] && print " WARNING ${DIR} is group writable" || print " ${DIR} is not group writable" ; [[ "$(ls -ld ${DIR} |awk '{print $3}')" != @(root|bin) ]] && print " WARNING ${DIR} is not owned by root or bin"; DIR=${DIR%/*}; done; done

I just get - ksh: 0403-057 Syntax error: `;' is not expected.

Is what I am trying possible?

Thank you
 
; is not expected here:
do ;

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top