3 ms·
Example script: #!/bin/bash trap '(( LINENO < 10+3 )) || { echo "Script executed more than 10 lines of code! Aborting."; exit 88; }' DEBUG echo 1
by v_lisivka 9y ago
Example script:
#!/bin/bash
trap '(( LINENO < 10+3 )) || { echo "Script executed more than 10 lines of code! Aborting."; exit 88; }' DEBUG
echo 1
echo 2
echo 3
echo 4
echo 5
echo 6
echo 7
echo 8
echo 9
echo 10
echo 11
$ ./test.sh
1
2
3
4
5
6
7
8
9
10
Script executed more than 10 lines of code! Aborting.