I have two following linux shell commands:
echo 'CPU type and model'
cat /proc/cpuinfo | head -5 | tail -1
When i run these commands directly in Terminal, i get this result truly:
CPU type and model
model name : Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz
But when i save them into a test.sh file and run sh test.sh, i get this error:
CPU type and model
tail: option used in invalid context -- 1
I also try bash test.sh and get this:
CPU type and model
tail: option used in invalid context -- 1

head -n 5 /proc/cpuinfo | tail -n 1? – rahmu Apr 23 '12 at 6:48: invalid number of lineserror. – Navid Farhadi Apr 23 '12 at 6:50headandtaildon't support the-noptions. That was not my point. You could tryhead -5 /proc/cpuinfo | tail -1– rahmu Apr 23 '12 at 7:07