xxxxxxxxxxxx BASH To Take MBR BAckup -- Shirish Shukla xxxxxxxxxxxxx
#!/bin/bash
hdds=$(echo /dev/[hs]d?)
for hdd in $hdds
do
## take only last name of dir
base=$(basename $hdd)
##take MBR Backup 0-512 bytes
dd if=$hdd of=/tmp/$base.mbr count=1 bs=512
echo $hdd
done
nice tips
ReplyDelete### read multiple file at a time
ReplyDeleteexec 7<$1
exec 8<$2
#for [[ read ln1 <&7 && read ln2 <&8 ]]
while read ln1 <&7 && read ln2 <&8
#`cat $2`
#while IFS=" " read ln1 <&`cat $1`
do
echo $ln1
echo $ln2
done
-- Shirish
it is top linux side i had surfed ever
ReplyDeletegood stuff
ReplyDelete