Issues with Excluding Files and Directories in find Command Using Constructed PRUNE_CMD
I’m working on a bash script to delete files and directories that are older than 1 day, excluding specific files and directories from deletion. When I hardcode the paths to exclude in the find command, it works correctly. However, when I construct the exclusion command dynamically using a variable (PRUNE_CMD), the results are not correct.
How to evaluate 2 variables using bash arithematic in if statement with AND operator in bash shell
I have an alphanumeric string, say something like “XXXX24Y2” from which i have extracted only the numbers and assigned them to 2 variables, say num1 and num2, say num1=24 and num2=2
Now i want to check (if num1 <=24 and num2 <2); then do something. I have tried all kinds of brackets double, single, square, with quotes around the variable, without etc. I dont get any errors. Its just that bash wont read that if statement.