I am trying to write a shell script to run Madgraph 5 but after entering the madgraph interface my script is not working
# !/bin/bash
run=${1}
nevt=${2}
#rnum=${3}
# Now let shell know where to find madgraph executables
cd /home/Luqman/
ls -l
rnum=`date +%s%N | cut -b11-18`
echo $rnum
# To run madgraph executable
./mg5
#Generate a process
./generate p p > t t~ , (t > w+ b , w+ > e+ ve),(t~ > w- b~ , w- > e- ve~)
#Make output
output test${run}
#replace the seed in the run card with ${rnum}
sed -i "s#[0-9]\+ *= *iseed# ${rnum} = iseed#g" test${run}
#if [ ! -e test${run}
# echo test${run}
# exit 1;
#fi
#replace the number of events in the run_card
sed -i "s#[0-9]\+ *= *nevents# ${nevt} = nevents#g" test${run}
launch test${run}
exit
~
I am using the above script to run madgraph but after ./mg5 command I get the madgraph interface and asks to do the other thing like generate, output, launch and other things by entering these command to the MG CLI. Idon't know how to include these commands to the shell script?
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Olivier Mattelaer
- Solved:
- Last query:
- Last reply: