Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux General Discussion (http://www.linux-archive.org/archlinux-general-discussion/)
-   -   a little creative parameter expansion simplifies stat_die() (http://www.linux-archive.org/archlinux-general-discussion/393373-little-creative-parameter-expansion-simplifies-stat_die.html)

Victor Lowther 06-30-2010 10:23 PM

a little creative parameter expansion simplifies stat_die()
 
On Wed, 2010-06-30 at 23:57 +0200, Thomas Bächler wrote:
> Nice patch, but ...
>
> > -if [ -t 1 ]; then
> > +if [[ -t 1 ]]; then
> > SAVE_POSITION="33[s"
> > RESTORE_POSITION="33[u"
> > DEL_TEXT="33[$(($STAT_COL+4))G"
> > @@ -116,10 +116,8 @@ stat_fail() {
>
> Hmm, this definitely doesn't belong into this patch.


Yeah, I think it got smashed together while I was rebasing things to
clean up.

> > }
> >
> > stat_die() {
> > - retval=1
> > - [ "$1" = "" ] || retval=$1
> > stat_fail
> > - exit $retval
> > + exit ${1:-1}
> > }
> >
> > status() {
>
> Okay, this is certainly nicer than before.
>

--
Victor Lowther
LPIC2 UCP RHCE


All times are GMT. The time now is 05:52 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.