0

I have a shell script that points to a Python script.

script.sh

#!/bin/bash python /folder/script.py 

The Python script takes an argument, for example script.py -d 20210107

I tried running the shell script with the date parameter like script.sh -d 20210107 but this is not working. Do I need to add something to my shell script to fix this?

0

1 Answer 1

2
#!/bin/bash python /folder/script.py "$@" 

Pass arguments from upper script to lower script with $@.

Sign up to request clarification or add additional context in comments.

3 Comments

@CharlesDuffy, ok added quotes.
what is the difference between $* and $@ ?
@AviG The latter correctly preserves inputs that were quoated and have spaces in them. The former basically gives you what you would have had if there the arguments were written with no quoting - so one arument with a space in it could be treated as two arguments.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.