Shell function-based usage tries to find all the configuration file content in each program directory in a loop function www.2cto.com #. The parameter is the name of the file to be processed and the function to be processed whilefun () # arg1 file $1, arg2 cmd $2 {while read linedo $2 $ linedone <$1} # handler, column file name and cat file content custcmd2 () # arg1 $ line {echo -------------------------- c2 ----- list filedir $1 echocat $1} # process the function, obtain the directory, locate the conf file, and process each conf file custcmd () in sequence () # arg1 $ line {cfdir = 'dirname $1 'cd $ cfdir echo ---------------------------- c1 ---------------------------- ls *. conf>/tmp/tmpfcf2 echo .. cat/tmp/tmpfcf2whilefun/tmp/tmpfcf2 custcmd2} # Find the program running ps-ef | grep home | grep server | grep-v grep | awk '{print $8 }' >/tmp/tmpfcf; # Start whilefun/tmp/tmpfcf custcmd