Wednesday, 14 July 2021

How To Run a Command Multiple Times in Terminal and PowerShell

# Print all the numbers from 1 to 100
for i in {1..100}; do echo ${i}; done
# Run the "e2e-tests" script 5 times to verify tests work reliably
for i in {1..5}; do npm run e2e-tests; done
# Run the "deploy-app-1/2/3/..." scripts to deploy the app to different servers

for i in {1..10}; do npm run deploy-app-${i}; done 


from: https://betterprogramming.pub/how-to-run-a-command-multiple-times-in-terminal-and-powershell-5af76df8d123

No comments:

Post a Comment

How to check if a file contains a specific string using Bash

 In case if you want to check whether file does not contain a specific string, you can do it as follows. if ! grep -q SomeString "$File...