I have this legacy delete script script, It is doing some delete work on a remote application.
When processing of delete is done it will return #completed successfully#
or it will return
#
*nothing more to delete*
*Program will exit*
#
I would like to assign its output and execute the delete script as long its output is "completed successfully
".
I am unable to assign the results of the script to a variable. I am running the shell script from folder X while the delete script is in folder Y. Besides the script below, I also tried:
response=$(cd $path_to_del;./delete.sh ...)
I am unable to make this work.
#!/bin/bash
path_to_del=/apps/Utilities/unix/
response='completed successfully'
counter=1
while [[ $response == *successfully* ]]
do
response= working on batch number: $counter ...
echo $response
(cd $path_to_del;./delete.sh "-physicalDelete=true") > $response
echo response $response
((counter++))
done
echo deleting Done!