From: rpe Date: Tue, 2 Jun 2015 19:39:18 +0000 (+0000) Subject: Replace X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=98b5e5c6b179d61b32fcf0485908c0a12cc1dd04;p=openbsd Replace [[ -n $(foo | grep 'bar') ]] with foo | grep -q 'bar' OK halex@ krw@ --- diff --git a/distrib/amd64/common/install.md b/distrib/amd64/common/install.md index c8a8738b9c3..99332b6908a 100644 --- a/distrib/amd64/common/install.md +++ b/distrib/amd64/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.39 2015/05/31 19:40:10 rpe Exp $ +# $OpenBSD: install.md,v 1.40 2015/06/02 19:39:18 rpe Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -51,9 +51,9 @@ md_prep_fdisk() { while :; do _d=whole - if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then + if fdisk $_disk | grep -q 'Signature: 0xAA55'; then fdisk $_disk - if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then + if fdisk $_disk | grep -q '^..: A6 '; then _q=", use the (O)penBSD area," _d=OpenBSD fi @@ -84,7 +84,7 @@ must be marked as the only active partition. Inside the fdisk command, the $(fdisk ${_disk}) __EOT fdisk -e ${_disk} - [[ -n $(fdisk $_disk | grep ' A6 ') ]] && return + fdisk $_disk | grep -q ' A6 ' && return echo No OpenBSD partition in MBR, try again. ;; o*|O*) return ;; esac diff --git a/distrib/armish/ramdisk/install.md b/distrib/armish/ramdisk/install.md index 98c40d9eb6d..1ec4072be12 100644 --- a/distrib/armish/ramdisk/install.md +++ b/distrib/armish/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.18 2015/05/31 19:40:10 rpe Exp $ +# $OpenBSD: install.md,v 1.19 2015/06/02 19:39:18 rpe Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -40,9 +40,9 @@ md_prep_fdisk() { while :; do _d=whole - if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then + if fdisk $_disk | grep -q 'Signature: 0xAA55'; then fdisk $_disk - if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then + if fdisk $_disk | grep -q '^..: A6 '; then _q=", use the (O)penBSD area," _d=OpenBSD fi @@ -73,7 +73,7 @@ must be marked as the only active partition. Inside the fdisk command, the $(fdisk ${_disk}) __EOT fdisk -e ${_disk} - [[ -n $(fdisk $_disk | grep ' A6 ') ]] && return + fdisk $_disk | grep -q ' A6 ' && return echo No OpenBSD partition in MBR, try again. ;; o*|O*) return ;; esac diff --git a/distrib/armv7/ramdisk/install.md b/distrib/armv7/ramdisk/install.md index a70e1c02d9b..1d5e2a2f50b 100644 --- a/distrib/armv7/ramdisk/install.md +++ b/distrib/armv7/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.10 2015/06/02 01:48:25 jsg Exp $ +# $OpenBSD: install.md,v 1.11 2015/06/02 19:39:19 rpe Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -136,7 +136,7 @@ md_prep_fdisk() { while :; do _d=whole - if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then + if fdisk $_disk | grep -q 'Signature: 0xAA55'; then fdisk $_disk else echo "MBR has invalid signature; not showing it." @@ -180,7 +180,7 @@ at least 16MB and be the first 'MSDOS' partition on the disk. $(fdisk ${_disk}) __EOT fdisk -e ${_disk} - [[ -n $(fdisk $_disk | grep ' A6 ') ]] && return + fdisk $_disk | grep -q ' A6 ' && return echo No OpenBSD partition in MBR, try again. ;; o*|O*) return ;; esac diff --git a/distrib/i386/common/install.md b/distrib/i386/common/install.md index f318e899d5e..f86fe24ceec 100644 --- a/distrib/i386/common/install.md +++ b/distrib/i386/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.62 2015/05/31 19:40:10 rpe Exp $ +# $OpenBSD: install.md,v 1.63 2015/06/02 19:39:19 rpe Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -51,9 +51,9 @@ md_prep_fdisk() { while :; do _d=whole - if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then + if fdisk $_disk | grep -q 'Signature: 0xAA55'; then fdisk $_disk - if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then + if fdisk $_disk | grep -q '^..: A6 '; then _q=", use the (O)penBSD area," _d=OpenBSD fi @@ -84,7 +84,7 @@ must be marked as the only active partition. Inside the fdisk command, the $(fdisk ${_disk}) __EOT fdisk -e ${_disk} - [[ -n $(fdisk $_disk | grep ' A6 ') ]] && return + fdisk $_disk | grep -q ' A6 ' && return echo No OpenBSD partition in MBR, try again. ;; o*|O*) return ;; esac diff --git a/distrib/landisk/ramdisk/install.md b/distrib/landisk/ramdisk/install.md index 12fbb2f0b4e..b8054a23e1d 100644 --- a/distrib/landisk/ramdisk/install.md +++ b/distrib/landisk/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.32 2015/05/31 19:40:10 rpe Exp $ +# $OpenBSD: install.md,v 1.33 2015/06/02 19:39:19 rpe Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -44,9 +44,9 @@ md_prep_fdisk() { while :; do _d=whole - if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then + if fdisk $_disk | grep -q 'Signature: 0xAA55'; then fdisk $_disk - if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then + if fdisk $_disk | grep -q '^..: A6 '; then _q=", use the (O)penBSD area," _d=OpenBSD fi @@ -77,7 +77,7 @@ must be marked as the only active partition. Inside the fdisk command, the $(fdisk ${_disk}) __EOT fdisk -e ${_disk} - [[ -n $(fdisk $_disk | grep ' A6 ') ]] && return + fdisk $_disk | grep -q ' A6 ' && return echo No OpenBSD partition in MBR, try again. ;; o*|O*) return ;; esac diff --git a/distrib/octeon/ramdisk/install.md b/distrib/octeon/ramdisk/install.md index 01739ba2d41..3ab20b7a3af 100644 --- a/distrib/octeon/ramdisk/install.md +++ b/distrib/octeon/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.8 2015/05/31 19:40:10 rpe Exp $ +# $OpenBSD: install.md,v 1.9 2015/06/02 19:39:19 rpe Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -53,9 +53,9 @@ md_prep_fdisk() { while :; do _d=whole - if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then + if fdisk $_disk | grep -q 'Signature: 0xAA55'; then fdisk $_disk - if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then + if fdisk $_disk | grep -q '^..: A6 '; then _q=", use the (O)penBSD area," _d=OpenBSD fi @@ -101,7 +101,7 @@ at least 16MB and be the first 'MSDOS' partition on the disk. $(fdisk ${_disk}) __EOT fdisk -e ${_disk} - [[ -n $(fdisk $_disk | grep ' A6 ') ]] && return + fdisk $_disk | grep -q ' A6 ' && return echo No OpenBSD partition in MBR, try again. ;; o*|O*) return ;; esac diff --git a/distrib/socppc/ramdisk/install.md b/distrib/socppc/ramdisk/install.md index 14474fe0ab5..19f2e214275 100644 --- a/distrib/socppc/ramdisk/install.md +++ b/distrib/socppc/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.20 2015/05/31 19:40:10 rpe Exp $ +# $OpenBSD: install.md,v 1.21 2015/06/02 19:39:19 rpe Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -48,9 +48,9 @@ md_prep_fdisk() { while :; do _d=whole - if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then + if fdisk $_disk | grep -q 'Signature: 0xAA55'; then fdisk $_disk - if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then + if fdisk $_disk | grep -q '^..: A6 '; then _q=", use the (O)penBSD area," _d=OpenBSD fi @@ -81,7 +81,7 @@ must be marked as the only active partition. Inside the fdisk command, the $(fdisk ${_disk}) __EOT fdisk -e ${_disk} - [[ -n $(fdisk $_disk | grep ' A6 ') ]] && return + fdisk $_disk | grep -q ' A6 ' && return echo No OpenBSD partition in MBR, try again. ;; o*|O*) return ;; esac diff --git a/distrib/zaurus/ramdisk/install.md b/distrib/zaurus/ramdisk/install.md index 52782a36eae..37421956452 100644 --- a/distrib/zaurus/ramdisk/install.md +++ b/distrib/zaurus/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.33 2015/05/31 19:40:11 rpe Exp $ +# $OpenBSD: install.md,v 1.34 2015/06/02 19:39:19 rpe Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -42,9 +42,9 @@ md_prep_fdisk() { while :; do _d=whole - if [[ -n $(fdisk $_disk | grep 'Signature: 0xAA55') ]]; then + if fdisk $_disk | grep -q 'Signature: 0xAA55'; then fdisk $_disk - if [[ -n $(fdisk $_disk | grep '^..: A6 ') ]]; then + if fdisk $_disk | grep -q '^..: A6 '; then _q=", use the (O)penBSD area," _d=OpenBSD fi @@ -75,7 +75,7 @@ must be marked as the only active partition. Inside the fdisk command, the $(fdisk ${_disk}) __EOT fdisk -e ${_disk} - [[ -n $(fdisk $_disk | grep ' A6 ') ]] && return + fdisk $_disk | grep -q ' A6 ' && return echo No OpenBSD partition in MBR, try again. ;; o*|O*) return ;; esac