This works from the terminal:
I want it in a bash script, using a variable. I tried:
device="a" ls "/dev/sd"$device"*"
But I get the error:
ls: cannot access '/dev/sda*': No such file or directory.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community