Reputation: 133
I want to test a shell script using some-script.sh foo
on ideone
.
In Python we might do something like sys.argv.extend('foo')
to simulate command line argument.
How to simulate command line argument in bash?
Upvotes: 0
Views: 612
Reputation: 242103
To populate the variables $1
, $2
etc., you can use
set -- arg1 arg2
Upvotes: 3