Re: Detecting disk drives from an installation script
On Wed, 20 Jun 2007 16:29:12 +0200
Michelle Konzack <linux4michelle@freenet.de> wrote:
> Am 2007-06-14 19:00:47, schrieb Orestes leal:
> > $fdisk -l | grep dev | gawk -F' *' '{ print $1 }' | gawk -F'/dev/' '{ print $0 }' | grep '/dev/sd' > particiones.txt
>
> Can you tell me which version of "fdisk" you are using?
> "fdisk -l" returns nothing at all (¶USER or root)
fdisk v2.12r
>
> > detecta2=$($fdisk -l | grep $particion | grep + | gawk -F'+' '{ print $2}' | gawk -F' ' '{ print $2 }')
> > detecta3=$($fdisk -l | grep $particion | grep + | gawk -F'+' '{ print $2}' | gawk -F' ' '{ print $1 }')
> > $fdisk -l | grep dev | gawk -F' *' '{ print $1 }' | gawk -F'/dev/' '{ print $0 }' | grep '/dev/hd' > particiones.txt
> > detecta2=$($fdisk -l | grep $particion | grep + | gawk -F'+' '{ print $2}' | gawk -F' ' '{ print $2 }')
> > detecta3=$($fdisk -l | grep $particion | grep + | gawk -F'+' '{ print $2}' | gawk -F' ' '{ print $1 }')
>
> And why do you run fdisk so many times?
I'am not a shell master at all, i'am a newbie.
>
> You can use ONCE:
>
> FDISKOUT=$(fdisk -l)
>
> and then
>
> echo -e "${FDISKOUT}" | some_command ...
> ^^
> Do not forget it. :-)
Thanks.
>
> Thanks, Greetings and nice Day
Ore.
Orestes <orestesleal13022@cha.jovenclub.cu>
Reply to: