Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
These work fine:
/bin/dash xyz.sh arg1 curl | /bin/dash -
Use case:
curl | sh - arg1
Ubuntu executes this as:
curl | /bin/dash - arg1
this fails with: sh: 0: Can't open arg1
sh: 0: Can't open arg1
How do I pass arg1 to curl | /bin/dash?
curl | /bin/dash
Here's a lark, to pass e.g. the localhost localhost arguments to curl as requested:
localhost localhost
curl
echo curl --head '"$@"' | sh -s localhost localhost
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.