Region Copy: Mac cut doesn't have --output-delimiter, use tr instead

This commit is contained in:
Dave Stern 2013-04-10 14:51:55 -04:00
parent 09cee91c56
commit c63fc636e6

View File

@ -156,9 +156,9 @@ purge_EBS_Snapshots()
region_copy_EBS_Snapshots() region_copy_EBS_Snapshots()
{ {
#snapshots_to_region_copy is a list of all snapshot_ids with RegionCopy=.*:scheduled.* #snapshots_to_region_copy is a list of all snapshot_ids with RegionCopy=.*:scheduled.*
# --output-delimiter and $'n' substitution used so $IFS doesn't have to be # tr and $'n' substitution used so $IFS doesn't have to be
# manipulated with for loops and the cut command # manipulated with for loops and the cut command
snapshot_tag_list=$(ec2-describe-tags --show-empty-fields --region $region --filter resource-type=snapshot --filter key=RegionCopy | grep ':scheduled' | cut -f3,5- --output-delimiter='~') snapshot_tag_list=$(ec2-describe-tags --show-empty-fields --region $region --filter resource-type=snapshot --filter key=RegionCopy | grep ':scheduled' | cut -f3,5- | tr '[\t ]' '~')
for snapshot_data in $(echo ${snapshot_tag_list//$'\n'/ } | cut -f1-) for snapshot_data in $(echo ${snapshot_tag_list//$'\n'/ } | cut -f1-)
do do