how can I get the paths to all sd cards in a computer using GNU bash 4.3.11 running Ubuntu 14.04 and just those?
Background:
I have an .iso-file and want to create a bash script that asks the user to which sd card he wants that .iso-file to be written. The script should not offer him internal hard drives or cd/dvd-drives, just sd card paths.
Actually I manually use
ls -la /dev/sd*
which for example gives me on a test machine
brw-rw---- 1 root disk 8, 0 May 3 10:54 /dev/sda
brw-rw---- 1 root disk 8, 1 May 3 10:54 /dev/sda1
brw-rw---- 1 root disk 8, 2 May 3 10:54 /dev/sda2
brw-rw---- 1 root disk 8, 5 May 3 10:54 /dev/sda5
brw-rw---- 1 root disk 8, 16 May 3 15:12 /dev/sdb
brw-rw---- 1 root disk 8, 17 May 3 14:56 /dev/sdb1
brw-rw---- 1 root disk 8, 18 May 3 14:56 /dev/sdb2
I "know" that sda is my hard drive in that case because I know the hardware of the computer and therefor so sdb must be the sd card, but how can an algorithm do this?
lsblk,blkid,/etc/fstab,mount(look for things that are mounted but are not infstab),lsusb(to exclude USB drives) etc.