0

I am running a script which checks something inside the command line. If it exists, then the whole command line is ran (with all other options specified in the command). Otherwise, something else should be done.

The command is ./run -I -X -l nodes=1:ppn=4. So, I wrote:

#!/bin/bash
for i in "$@" 
do
  case $i in
   -I)
      echo "Interactive job started"
      SHOULD RUN THE WHOLE COMMAND SPECIFIED IN THE COMMAND LINE
      exit
      ;;
  esac
done
#do something else

How can I get the whole command line inside a bash script?

1 Answer 1

1

This command prints the entire command line inside a bash script

echo $0 $@
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.