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.
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!mpirun -np $NPROCS someapp
and inject dplace options2 between 'someapp' transparently so it becomes:mpirun -np $NPROCS dplace -s1 -c 0-$TOP_PROC someapp
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).