Variable causing issue while doing the test command in unix Command is::
find $PWD -type d -exec sh -c 'test "{}" ">" "$PWD/$VersionFolders"' \; -print|wc -l`
Input Values-
Here $PWD- Current Directory
b1_v.1.0 b1_v.1.2 b1_v.1.3 b1_v.1.4
Given Version folder as $VersionFolders b1_v.1.2
The Command should check if any folders exist in current directory which is greater than the give version folder and it should count or display. This approach has to be consider with out date or time created of folders.
Expected Output- b1_v.1.3 b1_v.1.4
If I give hard code Directories its working fine. But when I pass it like as variable.it give all folders.
working fine this commend-
find $PWD -type d -exec sh -c 'test "{}" ">" "$PWD/b1_v.1.2"' \; -print|wc -l`
Not working this command with variable- find $PWD -type d -exec sh -c 'test "{}" ">" "$PWD/$VersionFolders"' ; -print|wc -l`