Good day! I’m trying to create a shell script that will do the ff.
- list all files which has a name of core.* from a specific directory (/opt/info)
- count number of core.* files
- if core.* > 0
then return number of core files
ECHO “Core files exist:
- get the filename of one of the core files (can be random or sequential)
- use the filename in the script that will be executed below:
execute the script: strings (core.*) | grep “pmdtm(“
- if the script in #5 doesn’t work or no values returned
then echo “ERROR: Script1 didn’t worked!” and execute the script: file (core.*) and print the results.
else print the results in script1.
- Assign the results to parameter/variables.