1
1
Say I have two binary files: binary1 and binary2.
Each of them has its own option set: options1 and options2.
Users need to invoke a command that follows this structure:
binary1 options1 binary2 options2
However, I want to set options2 myself and make them run the following:
binary1 options1 alias
where
alias='binary2 options2'
Is there any way to make this work under bash/tcsh? I am working under SLES 11 SP2 over 64bit architecture.
If what you really want them to type is something like:
binary1 optionset1 binary2
and have it become:
binary1 optionset1 binary2 optionset2
where optionset2 is what YOU define then what you really need to fake is binary1; but in the comments below you said that you cannot choose what binary1 is. Is that correct? – Ahmed Masud – 2013-06-05T12:38:39.343
I need binary1 to be
mpirun
andoptions1
to be-np $NPROCS
(where NPROCS is the number of processors and its value is retrieved from the environment). Then comes binary2, calleddplace
and the options (options2) are-s1 -c 0-$TOP_PROC
(being$TOP_PROC=$NPROC-1
). Currently users use the command:mpirun -np $NPROCS dplace application_executable_binary
. I want to introduce the options for dplace in a transparent way so the have not to change the way they submit jobs to the queue. Thank you! – None – 2013-06-05T12:50:57.050Okay there is a bit more confusion on my part; I want to understand this correctly:
You want the user to type
mpirun -np $NPROCS someapp
and inject dplace options2 between 'someapp' transparently so it becomes:mpirun -np $NPROCS dplace -s1 -c 0-$TOP_PROC someapp
– Ahmed Masud – 2013-06-05T12:56:48.603I want the users to type
mpirun -np $NPROCS dplace someapp
. I wantdplace
to appear explicitly, that is, want them to type what they have been typing so far. That's why I need to introduce those options in "silent mode". Thank you! (I could do it in C, but I wonder if it can be done via shell scripting). – None – 2013-06-05T13:05:22.293