diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2012-12-17 10:03:39 +0100 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2013-01-20 19:19:00 +0100 |
commit | 09a464eb213212ac6538bc4bba9d2e391562b100 (patch) | |
tree | 8c14b0144bd54f21d34af3613bd13e365a2a293e /contrib/allwindows.sh | |
parent | 70ae853c054dd2b1b6cbf2fcffb678331ae3a031 (diff) | |
download | ratpoison-09a464eb213212ac6538bc4bba9d2e391562b100.zip |
basic contrib/ cleanup
* (*.pl, rpws) don't hardcode path to Perl but rely on /usr/bin/env
* (allwindows.sh) don't require bash
* (rpshowall.sh) properly handle arguments, use portable shell arithmetic
* (*.sh) use more quotes
* (*.pl, split.sh) use 'ratpoison' if RATPOISON isn't in the environment
(and don't error out)
Diffstat (limited to 'contrib/allwindows.sh')
-rwxr-xr-x | contrib/allwindows.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/allwindows.sh b/contrib/allwindows.sh index 995f367..a1c291b 100755 --- a/contrib/allwindows.sh +++ b/contrib/allwindows.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Copyright (C) 2003 Rupert Levene # Author: Rupert Levene <r.levene@lancaster.ac.uk> @@ -12,15 +12,15 @@ IFS=' list='' # Allow external scripts to tell it where ratpoison is -if [ -z $RATPOISON ]; then +if [ -z "$RATPOISON" ]; then RATPOISON=ratpoison fi GROUPLIST=$($RATPOISON -c groups) SED_GET_NUM='s/^\([0-9]*\).*/\1/' -FIRSTGROUPNUM=$(echo "$GROUPLIST"|head -1|sed -e "$SED_GET_NUM") -LASTGROUP=$(echo "$GROUPLIST"|tail -1) +FIRSTGROUPNUM=$(echo "$GROUPLIST"|head -n 1|sed -e "$SED_GET_NUM") +LASTGROUP=$(echo "$GROUPLIST"|tail -n 1) CURRENTGROUPNUM=$(echo "$GROUPLIST"|grep '^[0-9]*\*'|sed -e "$SED_GET_NUM") $RATPOISON -c "gselect $FIRSTGROUPNUM" |