Not being able to export number of events into command script

Asked by Yannick Burkard

Dear users,

I am trying to generate 100'000 gg > H events by directly executing an .sh script, in which I directly define the directory to such process and number of events. For that I execute in the terminal `./ gg_to_H 100000`, where contains the following lines:


process_directory = $1
nevents = $2
export process_directory
export nevents
./bin/mg5_aMC $simulation_commands

and the simmulation_commands refers to an .sh file ( with the following lines:

launch $directory_name
set nevents $nevents

the $directory_name is perfectly recognized in this script, whereas the $nevents is not; I obtain the following error:

WARNING: Invalid input: Expected number and not '$nevents'

It seems like $nevents is not being recognized as an integer. Does anyone know what is the solution to this? Any help would be appreciated!

Question information

English Edit question
MadGraph5_aMC@NLO Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :

Sorry I'm not a bash expert in order to identify what the issue is.

But what surprise me is how directory_name is even defined since you do not define it anywhere.
I guess if you follow the same setup for both parameter you should get the same behavior.



Revision history for this message
Yannick Burkard (yburkard) said :

I'm sorry, I meant to write 'directory_name' instead of 'process_directory' in the very first and third code lines above. So basically this string passes without an issue, but not the number $nevents.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :

But if they are set in the same way, it should behaves in the same way...
Are you sure that you have not setup one variable directly at your shell level or something like that?

Sorry but I'm not sure how to help


Can you help with this problem?

Provide an answer of your own, or ask Yannick Burkard for more information if necessary.

To post a message you must log in.