From 4e50a92041c9f30deef1a32c995b9d5634cbed22 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Fri, 23 Jun 2017 13:55:22 -0400 Subject: Remove unnecessary 'env' invocation from printf. This reverts part of pull request #217 which called the 'env' binary for each printf invocation. --- projects/cros-scripts/install/cros-medium-setup | 46 ++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'projects/cros-scripts/install/cros-medium-setup') diff --git a/projects/cros-scripts/install/cros-medium-setup b/projects/cros-scripts/install/cros-medium-setup index b33c6744..b50fad76 100755 --- a/projects/cros-scripts/install/cros-medium-setup +++ b/projects/cros-scripts/install/cros-medium-setup @@ -32,22 +32,22 @@ GPT_SIZE=34 KERNEL_SIZE=16384 usage() { - env printf '%s\n' "$executable [action] [storage] [rootfs tarball|kernel files] [medium]" >&2 + printf '%s\n' "$executable [action] [storage] [rootfs tarball|kernel files] [medium]" >&2 - env printf '\n%s\n' 'Actions:' >&2 - env printf '%s\n' ' partitions - Setup partitions on storage' >&2 - env printf '%s\n' ' rootfs - Install rootfs tarball to storage' >&2 - env printf '%s\n' ' kernel - Install kernel files to storage' >&2 + printf '\n%s\n' 'Actions:' >&2 + printf '%s\n' ' partitions - Setup partitions on storage' >&2 + printf '%s\n' ' rootfs - Install rootfs tarball to storage' >&2 + printf '%s\n' ' kernel - Install kernel files to storage' >&2 usage_storage - env printf '\n%s\n' 'Environment variables:' >&2 - env printf '%s\n' ' KERNEL_PATH - Path to the kernel image' >&2 - env printf '%s\n' ' VBOOT_TOOLS_PATH - Path to vboot tools' >&2 + printf '\n%s\n' 'Environment variables:' >&2 + printf '%s\n' ' KERNEL_PATH - Path to the kernel image' >&2 + printf '%s\n' ' VBOOT_TOOLS_PATH - Path to vboot tools' >&2 } usage_storage() { - env printf '\n%s\n' 'Storage:' >&2 + printf '\n%s\n' 'Storage:' >&2 local nodes=$( ls "$SYS_BLOCK_PATH" ) local node_path @@ -67,7 +67,7 @@ usage_storage() { continue fi - env printf '%s\n' " $node_path - $name" >&2 + printf '%s\n' " $node_path - $name" >&2 done } @@ -77,9 +77,9 @@ storage_affect_confirm() { local name=$( storage_name "$storage_path" ) local confirm - env printf '%s\n' 'This is going to affect the following storage:' - env printf '%s\n' " $storage_path - $name" - env printf '%s' 'Press enter to confirm: ' + printf '%s\n' 'This is going to affect the following storage:' + printf '%s\n' " $storage_path - $name" + printf '%s' 'Press enter to confirm: ' read confirm } @@ -104,17 +104,17 @@ storage_name() { return 0 fi - name=$( env printf '%s\n' "$name" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" ) + name=$( printf '%s\n' "$name" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" ) if [ -f "$vendor_path" ] then vendor=$( cat "$vendor_path" ) - vendor=$( env printf '%s\n' "$vendor" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" ) + vendor=$( printf '%s\n' "$vendor" | sed -e "s/^[[:space:]]*//;s/[[:space:]]*$//" ) name="$vendor $name" fi - env printf '%s\n' "$name" + printf '%s\n' "$name" } storage_partition_path() { @@ -133,7 +133,7 @@ storage_partition_path() { return 1 fi - env printf '%s\n' "$storage_partition_path" + printf '%s\n' "$storage_partition_path" } storage_partition_mount_path() { @@ -141,7 +141,7 @@ storage_partition_mount_path() { local storage_partition_mount_path=$( udisksctl info -b "$storage_partition_path" | grep "MountPoints" | sed "s/.*MountPoints:[[:space:]]*\(.*\)/\1/g" ) - env printf '%s\n' "$storage_partition_mount_path" + printf '%s\n' "$storage_partition_mount_path" } partitions() { @@ -161,7 +161,7 @@ partitions() { udisksctl unmount -b "$partition" || true done - ( env printf '%s\n' "g" ; env printf '%s\n' "w" ) | fdisk "$storage_path" + ( printf '%s\n' "g" ; printf '%s\n' "w" ) | fdisk "$storage_path" cgpt create "$storage_path" @@ -180,7 +180,7 @@ partitions() { mkfs.ext4 -F "$storage_rootfs_path" - env printf '\n%s\n' "Setup partitions on storage $storage_path" + printf '\n%s\n' "Setup partitions on storage $storage_path" } rootfs() { @@ -201,7 +201,7 @@ rootfs() { udisksctl unmount -b "$storage_rootfs_path" - env printf '\n%s\n' "Installed rootfs on storage $storage_path" + printf '\n%s\n' "Installed rootfs on storage $storage_path" } kernel() { @@ -230,7 +230,7 @@ kernel() { udisksctl unmount -b "$storage_rootfs_path" - env printf '\n%s\n' "Installed kernel on storage $storage_path" + printf '\n%s\n' "Installed kernel on storage $storage_path" } requirements() { @@ -243,7 +243,7 @@ requirements() { if [ -z "$requirement_path" ] then - env printf '%s\n' "Missing requirement: $requirement" >&2 + printf '%s\n' "Missing requirement: $requirement" >&2 exit 1 fi done -- cgit v1.2.3-70-g09d2