Hi,
My goal is to have a single script that would output something like this:
Code:
sas15kr1001-1 =197 MB/s
sas15kr1001-16 =209 MB/s
on several disk by running the 2 following commands
Code:
dd if=/dev/zero of=/sas15kr1001/test.io bs=64k count=1k conv=fdatasync
dd if=/dev/zero of=/sas15kr1001/test.io bs=64k count=16k conv=fdatasync
where sas15kr1001 is the mount point of a disk and "1" and "16" is the number thousand block of 64k written on the disk.
So i wrote this script
Code:
#!/bin/bash
adisk=( sas15kr1001 sas10kr501 sas15kr502 r10a r10b )
for i in "${adisk[@]}"
do
# echo $i
acount=( "1" "16" )
for c in "${acount[@]}"
do
dd if=/dev/zero of=/`$i`/test.io bs=64k count=`$c`k conv=fdatasync 2>&1 |& awk '/copied/ {print "'$i'- '$c'=" $8 " " $9}'
done
done
While the command
Code:
dd if=/dev/zero of=/sas15kr1001/test.io bs=64k count=1k conv=fdatasync 2>&1 |& awk '/copied/ {print "sas15kr1001-1=" $8 " " $9}'
return
Code:
sas15kr1001-1=181 MB/s
when i run the script, the output is quite weird
Code:
./testio.sh
./testio.sh: line 9: sas15kr1001: command not found
./testio.sh: line 9: 1: command not found
sas15kr1001- 1=188 MB/s
./testio.sh: line 9: sas15kr1001: command not found
./testio.sh: line 9: 16: command not found
sas15kr1001- 16=200 MB/s
any one can point me where i get it wrong ?
Cheers