I have a bash file with commands to merge pcap files. I want to know if there is anyway to make sure a line in bash runs or not. Like in windows bat file we have %ErrorLevel% ¨ Say a command
touch -r dcn_file "${dir_dcn}"/"${TAG1_dcn}".pcap
How do I make sure this was run?
echo $?which is the return value of the last command executed – Kiwy 2 days agoset -eto make bash exit on failure automatically. You can also assign additional code usingtrapto be executed in case of error (or just at the end regardless of errors) – Vi. 2 days ago