diff --git a/gw-ibm.1200 b/gw-ibm.1200 index 84ac091..188be6d 100755 --- a/gw-ibm.1200 +++ b/gw-ibm.1200 @@ -35,15 +35,12 @@ function extract { # Get list of files mdir -i "$img" 2>&1 | tee -a $log_extract - dir="$(mdir -i "$img" | tail -n +5 | head -n -3)" # Create destination mkdir -p "$name-files" - # Extract each file - while IFS= read -r line || [[ -n $line ]]; do - mcopy -i $img ::"$(echo "$line" | awk '{print $1}').$(echo "$line" | awk '{print $2}')" "$name-files" - done < <(printf '%s' "$dir") + # Extract recursively + mcopy -i "$img" -s -p :: "$name-files" } diff --git a/gw-ibm.1440 b/gw-ibm.1440 index e8ed9e2..82321c3 100755 --- a/gw-ibm.1440 +++ b/gw-ibm.1440 @@ -35,15 +35,12 @@ function extract { # Get list of files mdir -i "$img" 2>&1 | tee -a $log_extract - dir="$(mdir -i "$img" | tail -n +5 | head -n -3)" # Create destination mkdir -p "$name-files" - # Extract each file - while IFS= read -r line || [[ -n $line ]]; do - mcopy -i $img ::"$(echo "$line" | awk '{print $1}').$(echo "$line" | awk '{print $2}')" "$name-files" - done < <(printf '%s' "$dir") + # Extract recursively + mcopy -i "$img" -s -p :: "$name-files" } diff --git a/gw-ibm.160 b/gw-ibm.160 index dff6058..7bd76b8 100755 --- a/gw-ibm.160 +++ b/gw-ibm.160 @@ -35,15 +35,12 @@ function extract { # Get list of files mdir -i "$img" 2>&1 | tee -a $log_extract - dir="$(mdir -i "$img" | tail -n +5 | head -n -3)" # Create destination mkdir -p "$name-files" - # Extract each file - while IFS= read -r line || [[ -n $line ]]; do - mcopy -i $img ::"$(echo "$line" | awk '{print $1}').$(echo "$line" | awk '{print $2}')" "$name-files" - done < <(printf '%s' "$dir") + # Extract recursively + mcopy -i "$img" -s -p :: "$name-files" } diff --git a/gw-ibm.360 b/gw-ibm.360 index a8e688c..8ede644 100755 --- a/gw-ibm.360 +++ b/gw-ibm.360 @@ -35,15 +35,12 @@ function extract { # Get list of files mdir -i "$img" 2>&1 | tee -a $log_extract - dir="$(mdir -i "$img" | tail -n +5 | head -n -3)" # Create destination mkdir -p "$name-files" - # Extract each file - while IFS= read -r line || [[ -n $line ]]; do - mcopy -i $img ::"$(echo "$line" | awk '{print $1}').$(echo "$line" | awk '{print $2}')" "$name-files" - done < <(printf '%s' "$dir") + # Extract recursively + mcopy -i "$img" -s -p :: "$name-files" } diff --git a/gw-ibm.720 b/gw-ibm.720 index 61ac112..b055837 100755 --- a/gw-ibm.720 +++ b/gw-ibm.720 @@ -35,15 +35,12 @@ function extract { # Get list of files mdir -i "$img" 2>&1 | tee -a $log_extract - dir="$(mdir -i "$img" | tail -n +5 | head -n -3)" # Create destination mkdir -p "$name-files" - # Extract each file - while IFS= read -r line || [[ -n $line ]]; do - mcopy -i $img ::"$(echo "$line" | awk '{print $1}').$(echo "$line" | awk '{print $2}')" "$name-files" - done < <(printf '%s' "$dir") + # Extract recursively + mcopy -i "$img" -s -p :: "$name-files" }