Open file for read, process commands against list

(imported topic written by SystemAdmin)

I need to do the following within a bigfix action script. Can this be done?

cd /etc/rc3.d

for x in ls -1 S*| cut -c4-99

do

chkconfig $x off

chkconfig $x on

done

It creates a listing of files in /etc/rc.3, stripping the first 3 characters, then runs chkconfig off, followed by chkconfig on for each of them

(imported comment written by NoahSalzman)

Is that all you need to run in the Action? If yes, then all you need to do is run it verbatim in the Action, just pick the “sh” entry from the Action Script Type pop-up menu.

(imported comment written by SystemAdmin)

This is just one of a few items that will be in the action script.

The other items are also linux commands run with “wait sh …”

(imported comment written by NoahSalzman)

Write out the script to a file with “appendfile” and execute it using “waithidden”, perhaps? Otherwise you will need Relevance that replicates the functions of script and that will require constructive thought* to write given that your shell script has a “for loop” in it.

*It’s 9am Calif. time and the Peet’s hasn’t kicked in yet