0

This will work, when i hard code the name of the file I want to find.

ANSWER=`ssh -q username@hostname'ls "/some/directory/location/availablefiles.txt" | wc -l'`

It will not work when I try to pass it a variable and a wildcard, like the below example:

For example val=available , so the command should return the file beginning with available, which would be the same as the file in the first example, availablefiles.txt

ANSWER=`ssh -q username@hostname 'ls /some/directory/location/"$val"* | wc -l'`

Any ideas? Thanks

fedorqui
  • 252,262
  • 96
  • 511
  • 570
Blue42
  • 139
  • 3
  • 13

0 Answers0