Unanswered: writing shell scripts to delete files concatinate problem
I have an extremely limited knowledge of shell scripts. Here is what I want to do. I would like to set up a shell script to delete, "RM" command, db2 backups from the backup directory. So far, I've come up with a db2 select statement to get today's date - 2 months in a variable with a yyyymm format. Here's what I want to do:
pdate variable is equal to 200403 (built from sql script)
what I want to come up with is a command that looks like:
I don't care if it's pretty, I could hardcode the command in the shell as:
put the entire directory in a variable called $pdatecmd
However, I don't know enough to know how to concatinate literals/variables.
In OS390, I can build the entire statement in SQL, I can't get this to work in the aix shell command because i'm not sure how to delimeter strings within the sql statement. Any help would be appreciated. Thanks!!
your code worked to concatinate my variable into the statement. however, my db2 code to put the value into the statement didn't work. Is there a way to get the system date (minus 1 month) into a variable in a ccyymm format?