From: Florent A. <flo...@gm...> - 2010-07-30 04:33:51
|
Impressive! It works! Thanks Mike, Florent On Tue, Jul 27, 2010 at 6:04 AM, Michael Schatz <ms...@cs...> wrote: > Hi Florent, > > This is because of subtle differences in how /bin/sh and echo work on Mac > and Linux. Note the value in a ($shell) command is executed with "/bin/sh > -c" > > Here is what I get on my linux box: > > $ /bin/sh -c "echo -n `echo "scale=3; 1 - $MIN_IDENT / 100" | bc`" > .020 > > And on my mac: > > $ /bin/sh -c "echo -n `echo "scale=3; 1 - $MIN_IDENT / 100" | bc`" > -n .020 > > However, this is consistent on both: > > $ /bin/sh -c "/bin/echo -n `echo "scale=3; 1 - $MIN_IDENT / 100" | bc`" > .020 > > I suggest you update Minimo with /bin/echo -n instead of just echo -n. > > Good luck, > > Mike > > > > On Wed, Jul 21, 2010 at 11:25 PM, Florent Angly <flo...@gm...>wrote: > >> Hi, >> >> I have found that the runAmos program produces different results on >> Linux and MacOS causing some pipelines to fail on MacOS. I have a simply >> here that demonstrate a problem I encounter on MacOS. Both on Linux and >> MacOS, the following command (taken from Minimo) generates the expected >> result: >> > $MIN_IDENT=98 >> > $ echo -n `echo "scale=3; 1 - $MIN_IDENT / 100" | bc` >> > .020 >> >> Now put this in a pipeline and run it: >> > #!/opt/local/AMOS/bin/runAmos -C >> > MIN_IDENT = 98 >> > MAX_OVL_ERROR = $(shell echo -n `echo "scale=3; 1 - $(MIN_IDENT\) / >> > 100" | bc`) >> > 10: echo "MAX_OVL_ERROR='$(MAX_OVL_ERROR)'" >> >> The log file contains this information: >> > !!! 2010-07-22 13:04:40 Started by florent@UNKNOWN on Thu Jul 22 >> > 13:04:40 2010 >> > !!! 2010-07-22 13:04:40 Running: echo -n `echo "scale=3; 1 - 98 / >> > 100" | bc` >> > !!! 2010-07-22 13:04:40 Doing step 10 >> > !!! 2010-07-22 13:04:40 Running: echo "MAX_OVL_ERROR='-n .020 '" >> > MAX_OVL_ERROR='-n .020 ' >> > !!! 2010-07-22 13:04:40 Done! Elapsed time:0d 0h 0m 0s >> > !!! END - Elapsed time: 0d 0h 0m 0s >> >> '.020' was expected but I got '-n .020 '. That looks like a bug in >> runAmos on MacOS. Any idea how to fix this? >> Thanks, >> >> Florent >> >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> AMOS-help mailing list >> AMO...@li... >> https://lists.sourceforge.net/lists/listinfo/amos-help >> > > |