public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jiri Palecek <jpalecek@web.de>
To: subrata@linux.vnet.ibm.com
Cc: ltp-list@lists.sourceforge.net, Mike Frysinger <vapier@gentoo.org>
Subject: Re: [LTP] [PATCH] Fix some bashisms
Date: Tue, 7 Jul 2009 01:12:47 +0200	[thread overview]
Message-ID: <200907070112.53833.jpalecek@web.de> (raw)
In-Reply-To: <1246347670.4819.28.camel@subratamodak.linux.ibm.com>

On Tuesday 30 June 2009 09:41:10 Subrata Modak wrote:
> On Thu, 2009-06-25 at 14:39 +0530, Subrata Modak wrote: 
> > New Changes to Mikeś comments ?
> 
> Ping.

Ok, I finally got time to look into this. I'll send a separate patch which reflects the comments.

> > 
> > Regards--
> > Subrata
> > 
> > On Tue, 2009-06-23 at 17:21 -0400, Mike Frysinger wrote: 
> > > On Sunday 31 May 2009 17:27:51 Jiri Palecek > wrote:
> > > > --- a/testcases/commands/unzip/unzip_tests.sh
> > > > +++ b/testcases/commands/unzip/unzip_tests.sh
> > > > @@ -62,7 +62,6 @@ chk_ifexists()
> > > >  # 				- non-zero on failure.
> > > >  cleanup()
> > > >  {
> > > > -	popd
> > > >  	# remove all the temporary files created by this test.
> > > >  	tst_resm TINFO "CLEAN: removing \"$LTPTMP\""
> > > >  	rm -fr "$LTPTMP"
> > > > @@ -90,7 +89,6 @@ init()
> > > >  	# create the temporary directory used by this testcase
> > > >  	LTPTMP=`mktemp -d -t $$.XXXXXX` || tst_resm TBROK "Unable to create
> > > > temporary directory with: mktemp -d $$.XXXXXX" trap "cleanup" 0
> > > > -	pushd "$LTPTMP"
> > > >
> > > >  	# check if commands tst_*, unzip, awk, etc exists.
> > > >  	chk_ifexists INIT tst_resm  || return $RC
> > > 
> > > umm, you remove the push/popd, but dont replace it with proper cd statements ?  
> > > i'm guessing you didnt test this change.

Oh yes, I did, but I tested it with other changes which rendered the pushd/popd unnecessary. You're right this wouldn't work.

> > > > --- a/testcases/kernel/containers/netns/delchild.sh
> > > > +++ b/testcases/kernel/containers/netns/delchild.sh
> > > > -    kill -9 $sshpid $pid > /dev/null 2>&1
> > > > +    kill -s KILL $sshpid $pid > /dev/null 2>&1
> > > 
> > > this isnt a bashism, this is a crappy kill implementation

Formally speaking, this is an XSI extension to POSIX. I don't think this "-9" is any better than "-s KILL", so I won't change this.

> > > >  for tttype in `ls /dev/tty*`
> > > >  do
> > > > -device_no=${tttype:8}
> > > > +device_no=${tttype##/dev/tty}
> > > > ...
> > > >  for tttype in `ls /dev/tty*`
> > > >  do
> > > > -device_no=${tttype:8}
> > > > +device_no=${tttype##/dev/tty}
> > > 
> > > using the greedy expansion (##) doesnt make much sense.  really should be #.
> > > 
> > > > -    let step_errors="$step_errors + 1"
> > > > +    step_errors=$(($step_errors + 1))
> > > > -        let i="$i + 1"
> > > > +        i=$(($i + 1))
> > > > -            let k="$k + 1"
> > > > +            k=$(($k + 1))
> > > > -        let j="$j + 1"
> > > > +        j=$(($j + 1))
> > > > .....
> > > 
> > > this syntax sucks.  please use something like:
> > > : $(( step_errors += 1))

If it hurts your aesthetic sense ... ok.

> > > 
> > > > -    echo $"fs_inod on $TCtmp finished."
> > > > +    echo "fs_inod on $TCtmp finished."
> > > 
> > > these are not equivalent, but i doubt this shell script is using the bash 
> > > gettext function in the first place, so it's fine
> > > -mike
> > > ------------------------------------------------------------------------------
> > > _______________________________________________
> > > Ltp-list mailing list
> > > Ltp-list@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/ltp-list
> > 
> > 
> > ------------------------------------------------------------------------------
> > _______________________________________________
> > Ltp-list mailing list
> > Ltp-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ltp-list
> 
> 

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2009-07-06 23:10 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4a413e95.8d13f30a.1199.ffffdccbSMTPIN_ADDED@mx.google.com>
2009-06-23 21:21 ` [LTP] [PATCH] Fix some bashisms Mike Frysinger
2009-06-25  9:09   ` Subrata Modak
2009-06-30  7:41     ` Subrata Modak
2009-07-06 23:12       ` Jiri Palecek [this message]
     [not found] <200910211528.n9LFST8q028289@e35.co.us.ibm.com>
2009-10-26 17:02 ` Subrata Modak
2009-10-26 19:37   ` Garrett Cooper
2009-10-29 18:12   ` JiříPaleček
2009-10-30 11:37     ` Subrata Modak
2009-10-30 12:53       ` Jiří Paleček
2009-10-30 12:19         ` Subrata Modak
2009-10-31  6:39           ` Garrett Cooper
2009-10-31 11:42             ` Jiří Paleček
2009-11-01  0:15               ` Garrett Cooper
     [not found] <4adf2acd.8b13f30a.0849.7847SMTPIN_ADDED@mx.google.com>
2009-10-21 19:38 ` Mike Frysinger
2009-10-21  0:19 Jiri Palecek
  -- strict thread matches above, loose matches on Subject: below --
2009-07-07  8:35 Jiri Palecek
2009-07-07 15:32 ` Subrata Modak
2009-07-07 16:26   ` Garrett Cooper
2009-07-08 19:05   ` Mike Frysinger
2009-07-08 18:13 ` Subrata Modak
     [not found] <4a413e9b.160bca0a.2226.fffff184SMTPIN_ADDED@mx.google.com>
2009-07-06 17:45 ` Garrett Cooper
2009-07-06 22:02   ` Mike Frysinger
2009-07-06 22:47   ` Jiri Palecek
2009-07-06 23:33     ` Garrett Cooper
2009-07-07  0:16       ` Jiří Paleček
2009-07-07  0:31         ` Garrett Cooper
2009-07-07 10:29           ` Jiří Paleček
2009-05-31 21:27 Jiri Palecek >

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200907070112.53833.jpalecek@web.de \
    --to=jpalecek@web.de \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=subrata@linux.vnet.ibm.com \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox