Skip to main content
add strong quote explanation
Source Link
idobr
  • 1.7k
  • 4
  • 16
  • 32

Looks like wrong quotes. To put a result of bash command to a variable:

doFilesExist=$(find . -maxdepth 1 -type f) 

or

doFilesExist=`find . -maxdepth 1 -type f` 

The part with if block should be also changed to [ -z "$doFilesExist" ]: "Inside a single-quoted string nothing(!!!!) is interpreted, except the single-quote that closes the quoting" source.

Looks like wrong quotes. To put a result of bash command to a variable:

doFilesExist=$(find . -maxdepth 1 -type f) 

or

doFilesExist=`find . -maxdepth 1 -type f` 

Looks like wrong quotes. To put a result of bash command to a variable:

doFilesExist=$(find . -maxdepth 1 -type f) 

or

doFilesExist=`find . -maxdepth 1 -type f` 

The part with if block should be also changed to [ -z "$doFilesExist" ]: "Inside a single-quoted string nothing(!!!!) is interpreted, except the single-quote that closes the quoting" source.

Source Link
idobr
  • 1.7k
  • 4
  • 16
  • 32

Looks like wrong quotes. To put a result of bash command to a variable:

doFilesExist=$(find . -maxdepth 1 -type f) 

or

doFilesExist=`find . -maxdepth 1 -type f`