sh: 1: Syntax error: "(" unexpected error

<(command) is a bashism called Process substitution

You have to run your script with bash, eg do bash script.bash

Or if you want to use sh, you could write the results to a file, like this :

grep eth0 /proc/net/dev > file1 
sleep 1 ; grep eth0 /proc/net/dev > file2 
diff file1 file2

Leave a Comment