[Pkg-alsa-devel] Bug#602020: alsa-utils: [PATCH] Prefer POSIX $() to backquotes in debian/init
Jari Aalto
jari.aalto at cante.net
Sun Oct 31 20:24:50 UTC 2010
Package: alsa-utils
Version: 1.0.23-3
Severity: wishlist
The following patch updates to use POSIX[1] command substitution $() in
place of backtics (``).
Motivation:
- Recommended practise. The $() is recommend by many[2]. E.g. it nests easily
- Readability. In high resolution display a "tick" is hard to see. Selected
font may also make reading the "tick" difficult.
- Keyboards convenience. The backtick key may be placed in difficult
position in non-US keyboard. E.g acrobatics is needed with FI-keyboard
by pressing three keys in succession: AltGr + key + Space char
REFERENCES
[1]
POSIX standard IEEE Std 1003.1: 2.6.3 Command Substitution
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03
[2]
Bash manual: "...old-style backquote" in section "3.5.4 Command Substitution"
http://www.gnu.org/software/bash/manual/bashref.html#Command-Substitution
BashFAQ: Why is $(...) preferred over `...` (backticks)?
http://mywiki.wooledge.org/BashFAQ/082
Advanced Bash-Scripting Guide: "...The $(...) form has
superseded backticks for command substitution."
http://tldp.org/LDP/abs/html/commandsub.html
-----------------------------------------------------------------------
>From 697ce2d32a4f8ed8cdf8736e974e73f4ba53f78b Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aalto at cante.net>
Date: Sun, 31 Oct 2010 22:24:23 +0200
Subject: [PATCH] debian/init: Prefer POSIX command substitution
Organization: Private
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Signed-off-by: Jari Aalto <jari.aalto at cante.net>
---
debian/init | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/debian/init b/debian/init
index 248482c..ea807cb 100755
--- a/debian/init
+++ b/debian/init
@@ -233,7 +233,7 @@ preinit_levels_on_card()
# Silly dance to activate internal speakers by default on PowerMac
# Snapper and Tumbler
- id=`cat /proc/asound/card$1/id 2>/dev/null`
+ id=$(cat /proc/asound/card$1/id 2> /dev/null)
if [ "$id" = "Snapper" -o "$id" = "Tumbler" ]; then
switch_control "Auto Mute" off
switch_control "PC Speaker" off
--
1.7.2.3
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages alsa-utils depends on:
ii dialog 1.1-20100428-1 Displays user-friendly dialog boxe
ii libasound2 1.0.23-2 shared library for ALSA applicatio
ii libc6 2.11.2-6 Embedded GNU C Library: Shared lib
ii libncursesw5 5.7+20100313-4 shared libraries for terminal hand
ii linux-sound-base 1.0.23+dfsg-1 base package for ALSA and OSS soun
ii lsb-base 3.2-23.1 Linux Standard Base 3.2 init scrip
ii module-init-tools 3.12-1 tools for managing Linux kernel mo
ii udev 163-2 /dev/ and hotplug management daemo
ii whiptail 0.52.11-1 Displays user-friendly dialog boxe
Versions of packages alsa-utils recommends:
ii alsa-base 1.0.23+dfsg-1 ALSA driver configuration files
ii pciutils 1:3.1.7-5 Linux PCI Utilities
alsa-utils suggests no packages.
-- no debconf information
More information about the Pkg-alsa-devel
mailing list