From 31793483b1cf33fc4df6bdd168be393a9ad34da6 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 5 Aug 2013 23:50:47 +1200 Subject: Inline while loop in cd function with do --- bash/bashrc.d/cd.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'bash/bashrc.d/cd.bash') diff --git a/bash/bashrc.d/cd.bash b/bash/bashrc.d/cd.bash index 256acadd..3ee3329f 100644 --- a/bash/bashrc.d/cd.bash +++ b/bash/bashrc.d/cd.bash @@ -2,8 +2,7 @@ # emulating a Zsh function that I often find useful; preserves options too __cd() { local opts= - while getopts lPe opt - do + while getopts lPe opt; do opts="$opts -$opt" done shift $(($OPTIND-1)) -- cgit v1.2.3