Skip to content

Commit 65e1c91

Browse files
committed
tools: replace sed with awk to get exactly the last element
Signed-off-by: Andrej Valek <[email protected]>
1 parent 2594aee commit 65e1c91

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/wipe-linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/sh
22
set -e
33

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

0 commit comments

Comments
 (0)