-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
>> This is just weird in a coupla ways...
>
>> 1. Why use sed to remove the /dev/ of the device name, then
>> manually put it back every time you use it?
I think at one point before the final version I wanted to use it with
out "/dev/"
oh well I learnt how to use sed with "/" with out using this "sed
's/\/dev\///g'"
>> 2. Why append output to $FILE line by line when you can just
>> redirect the output of the for loop in one go?
>
I actually don't know, and I'm not sure how the "..." got in to the
awk comand either
#!/bin/bash
for i in /dev/sd? ; do
echo "Disk:$i ";
sudo hdparm -t $i |
grep "Timing" |
awk ' { print $11 $12 } ';
sudo fdisk -l $i |
grep "Disk $i" |
awk '{ print $3 $4 }' |
sed "s/,//g";
done > "speed test.txt"
yeah that is a lot simpler
at one point I was going to write it in python, but realised how
annoying it is to use the subprocess module to launch the commands
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkqVoYoACgkQGplaCYOFvyuG5QCfRp6wtLzjv0sxxdt3GJ9nlGqX
bhIAmgN99Hz1GB7rD9Ybo5iFbXHoQhw+
=TOz8
-----END PGP SIGNATURE-----