I want to write a shell script, which will run fdisk -l
and extract a string /dev/sdbn
from the output of fdisk -l
.
Using extracted word I want to mount it to /mnt
.
For Example:
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 493 3956672 6 FAT16
How do I only extract the string /dev/sdb1
?
/dev
, e.g. if you know it'ssdb
you can list/dev/sdb[1-9]*
.