Skip to main content

All Questions

0 votes
0 answers
16 views

How to append a "/*" to the end of a variable with spaces and glob it? [duplicate]

If I have a directory wibble, the following command does what I want: WIBBLE=wibble wc $WIBBLE/* If I have a directory foo bar, the following command does what I want: wc foo\ bar/* But this doesn'...
Ken Y-N's user avatar
  • 253
10 votes
2 answers
9k views

ls with a wildcard

This works from the terminal: ls /dev/sda* 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 ...
lonix's user avatar
  • 1,793
6 votes
2 answers
8k views

How to store a path built with wildcards and containing with spaces into a variable

Here's the situation (I'm on a Mac, OS X El Capitan): # This works: $ cd /Applications/Adobe\ Illustrator*/Cool\ Extras.localized/en_US/Templates/; # These do not work: $ INSTALL_DIR=/Applications/...
mhulse's user avatar
  • 1,809