[Swift-devel] Confused about app() command arg parsing/passing
Michael Wilde
wilde at mcs.anl.gov
Thu Dec 13 22:58:57 CST 2012
OK, this is resolved.
What was happening was interesting: the user was using a version of Swift in which I had introduced a bug. When I first added APP_RESOURCES, I used an eval command to make the argument passing work easier when inserting /usr/bin/time in front of the command.
This broke several other swift tests and use cases, so I had to fix it to comply with prior Swift arg processing.
However, the user's app showed how useful it could be to allow a full shell pipeline to be passed as the command body in an app. This seems to merit more thought, but I guess can be done using sh -c.
- Mike
----- Original Message -----
> From: "Michael Wilde" <wilde at mcs.anl.gov>
> To: "swift-devel" <swift-devel at ci.uchicago.edu>
> Sent: Thursday, December 13, 2012 11:19:20 AM
> Subject: [Swift-devel] Confused about app() command arg parsing/passing
> Im working with a user that has an app coded like this:
>
> app (file n) wgrib2 ( file g2, file nc_table) {
> wgrib2 @g2 "-match ':(TMP:2 m |APCP:|CRAIN:|DSWRF:)' -new_grid_winds
> earth -new_grid_interpolation neighbor -new_grid latlon 220.04\
> 1666666666:960:0.083333333333 20.041666666666:480:0.0833333333333 - |
> wgrib2 - -order we:sn -nc3 -nc_table" @nc_table "-netcdf" @n;
> }
>
> The user says this app works correctly, but I dont see how:
>
> - I dont see how args bundled within "" from -match through -nc_table
> get tokenized into single apps
>
> - even more mystifying is I dont see how the parts of the command line
> around "- | wgrib2" work. I.e. I dont see where this will get placed
> into a shell for correct interpretation.
>
> When I tried a simple example of this method using "echo" and "wc" as
> the apps, they fail as I would expect: the args within "" do not get
> separately tokenized and the "|" is placed on the command line within
> an arg and is not interpreted by any shell.
>
> I dont think I perturbed this behavior with the recent
> /usr/bin/time/APP_RESOURCES change in 0.94RC2, but thats possible.
>
> Can anyone explain whether the app command line should work, and if
> so, how?
>
> Thanks,
>
> - Mike
>
> --
> Michael Wilde
> Computation Institute, University of Chicago
> Mathematics and Computer Science Division
> Argonne National Laboratory
>
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
--
Michael Wilde
Computation Institute, University of Chicago
Mathematics and Computer Science Division
Argonne National Laboratory
More information about the Swift-devel
mailing list