I've got something like this:Error_code=1; num=5;Error_code=2; num=7;Error_code=3; num=9;Error_code=1; num=2;Error_code=2; num=5;. . .And a lot of error codes (about 100). Suppose the file is called performance.logHow can I use one command? Each time the error code is different.  I have something like this:grep -i error_code=$x; performance.log | \   awk -F; '{print $2}' > $x_error_code.txtSo each time, the variable x is a new value defined from the error code, and when the error codes finish, the script will finish.
Multiple inputs in one command
shell script;grep;variable
One awk script could do all this. This can also be done with pure Bourne shell script, like this one below:grep -E -o '[[:digit:]]+; num=[^;]+' performance.log \| while IFS=;  read n num; do    echo $num >> ${n}_error_code.txtdoneThe grep part extracts the substring EEE; num=NNN from your lines Error_code=EEE; num=NNN;. The while loop reads EEE and num=NNN and writes the latter in EEE_error_code.txtIf you are interested in just one particular error code (EEE below), you can change the grep command to:grep -E -o '\<EEE; num=[^;]+' performance.log | while ...If you are interested in a small set of error codes (EEE1...EEEn below), you can change the grep command to:grep -E -o '\<(EEE1|EEE2|...|EEEn); num=[^;]+' performance.log | while ...