About 44,600 results
Open links in new tab
  1. unix - Shell script "for" loop syntax - Stack Overflow

    Ideally, such a shell invoked as sh would only support those features in the POSIX standard, but by default let some of their extra features through. The C-style for-loop is not a POSIX feature, …

  2. How do I write a 'for' loop in Bash? - Stack Overflow

    Sep 8, 2008 · I commonly like to use a slight variant on the standard for loop. I often use this to run a command on a series of remote hosts. I take advantage of Bash's brace expansion to …

  3. bash - Shell equality operators (=, ==, -eq) - Stack Overflow

    It depends on the Test Construct around the operator. Your options are double parentheses, double brackets, single brackets, or test. If you use ((…)), you are testing arithmetic equality …

  4. Bourne Shell Scripting -- simple for loop syntax - Stack Overflow

    Sep 16, 2011 · How would I start and end the for loop (what is the syntax for this?). As you can see I'm not very familiar bourne shell programming. If you have any helpful websites or have a …

  5. How to iterate over arguments in a Bash script - Stack Overflow

    I have a complex command that I'd like to make a shell/bash script of. I can write it in terms of $1 easily: foo $1 args -o $1.ext I want to be able to pass multiple input names to the script. Wh...

  6. how to print prime numbers using for loop in shell script

    Feb 10, 2020 · I want to print prime numbers using for loop in shell script. Please provide some suggestions. actually I could able to print odd numbers from range of 1 to 100, but now I am …

  7. bash - for loop / if condition in shell script - Stack Overflow

    Aug 7, 2010 · I've never done shell script before and now I'm running into a simple problem... I have a for loop which executes every time the run.sh script. To see how far the script has …

  8. Loop through an array of strings in Bash? - Stack Overflow

    Jan 16, 2012 · Note that the double quotes around "${arr[@]}" are really important. Without them, the for loop will break up the array by substrings separated by any spaces within the strings …

  9. syntax of for loop in linux shell scripting - Stack Overflow

    Apr 12, 2011 · A standard POSIX shell only accepts the syntax for varname in list The C-like for-loop syntax for (( expr1; expr2; expr3 )) is a bashism. You can get similar behavior in the …

  10. shell script for multiplication table - Stack Overflow

    Apr 16, 2011 · Your code doesn't match your sample output. You posted mul.sh and ran table1.sh.

Refresh