Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I have this simple for loop
#!/bin/bash for number in {1..10} do echo $number done
but when I execute it with sh test.sh the output is
{1..10}
You declare at the top that the script uses bash and run it with sh.
If you just type this in the command line it will work:
./name_of_the_script
Alternatively, you can call on the bash interpreter explicitly:
bash name_of_the_script
Add a comment
for i in $(seq 1 10); do echo $i done
Required, but never shown
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.
Explore related questions
See similar questions with these tags.