I have the following example file
/etc/sysconfig/network/script.sh = -exe $Builder
run_installation 123 44 556 4 = run_installation arg1 arg2 arg3 948
EXE=somthing
EXE somthing
I have three questions (I write bash script)
- how to verify by sed or awk if the string “-exe” exist after “=” character
-
how to verify by sed or awk if the string run_installation exist in the first of the line (the first word in the line) and after the “=” character as example below (file)
-
the string EXE in file can be “EXE” or as “EXE=” , how to delete by sed the EXE or EXE=
I do:
sed s'/EXE//g' | sed s'/EXE=//g'but its not nice way to do in my bash script
• I need three different answers!
Lidia
you did not give further criteria on what to do if conditions 1 and 2 are not found…
The above code checks for condition 1 and condition 2 and print “ok” when both are found. The substitution of EXE for condition 3 is added for illustration purpose. State more clearly what you want to do and show your expected output next time
To verify them separately,