View Issue Details

IDProjectCategoryView StatusLast Update
0000668OpenFOAMBugpublic2012-10-27 13:21
Reporteruser461Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSDebianOS VersionSid
Summary0000668: runApplication does not pass on vectors correctly
DescriptionWhen I run the following from the command line (bash):

. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication surfaceTransformPoints -translate "(0 0 1)" file1.stl file2.stl

I get an error in log.surfaceTransformPoints:

--> FOAM FATAL ERROR:
Wrong number of arguments, expected 2 found 4

FOAM exiting

However, running:

surfaceTransformPoints -translate "(0 0 1)" file1.stl file2.stl

runs fine. Somehow the runApplication script does not pass on the vector correctly.
Steps To ReproduceSee Description
TagsNo tags attached.

Activities

wyldckat

2012-10-24 21:58

updater   ~0001743

I found this issue sometime ago as well and ended up ignoring it because I couldn't find a fix for it...

Nonetheless, today I think I found it: http://stackoverflow.com/questions/4824590/propagate-all-arguments-in-a-bash-shell-script

Basically, edit the file "$WM_PROJECT_DIR/bin/tools/RunFunctions" and replace the occurrences of:
  $*

for:
  "$@"

And it should work next time the script is sourced again!

I also found a good explanation on this subject ($* vs $@) here: http://wiki.bash-hackers.org/scripting/posparams#mass_usage

user461

2012-10-25 20:19

  ~0001744

Worked perfectly. Thanks!

henry

2012-10-27 13:21

manager   ~0001749

Thanks for the report, fix and useful reference.
Resolved by commit 949ec0dcff28d2e0f44aa62a28f3e328d65bffad

Issue History

Date Modified Username Field Change
2012-10-24 20:37 user461 New Issue
2012-10-24 21:58 wyldckat Note Added: 0001743
2012-10-25 20:19 user461 Note Added: 0001744
2012-10-27 13:21 henry Note Added: 0001749
2012-10-27 13:21 henry Status new => resolved
2012-10-27 13:21 henry Resolution open => fixed
2012-10-27 13:21 henry Assigned To => henry