Skip to content

Commit

Permalink
tools: replace sed with awk to get exactly the last element
Browse files Browse the repository at this point in the history
Signed-off-by: Andrej Valek <andy@skyrain.eu>
  • Loading branch information
andy9a9 committed Mar 26, 2022
1 parent 2594aee commit 65e1c91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/wipe-linux.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh
set -e

diskutil list | grep Apple_APFS | grep '\b2\.5 GB' | sed 's/.* //g' | while read i; do
diskutil list | awk '/Apple_APFS.* 2\.5 GB/{print $NF}' | while read i; do
diskutil apfs deleteContainer "$i"
done
diskutil list /dev/disk0 | grep -Ei 'asahi|linux|EFI' | sed 's/.* //g' | while read i; do
diskutil list /dev/disk0 | awk 'tolower($0) ~ /asahi|linux|EFI/{print $NF}' | while read i; do
diskutil eraseVolume free free "$i"
done

Expand Down

0 comments on commit 65e1c91

Please sign in to comment.