# Learning Bash for Loop today

# Learning Bash for Loop today

```bash
#!/bin/bash
        
for i in $( ls ); do
  echo item: $i
done
```


```bash
#!/bin/bash
# Basic for loop
names='Stan Kyle Cartman'
for name in $names
do
echo $name
done
echo All done
```


```bash
#!/bin/bash
# Basic range in for loop
for value in {1..5}
do
echo $value
done
echo All done
```


```bash
#!/bin/bash
# Basic range with steps for loop
for value in {10..0..2}
do
echo $value
done
echo All done
```



```bash
#!/bin/bash
# Make a php copy of any html files
for value in $1/*.html
do
cp $value $1/$( basename -s .html $value ).php
done
```

[Bash For Loop](https://www.howtouselinux.com/post/bash-for-loop-examples)# Learning Bash for Loop today

```bash
#!/bin/bash
        
for i in $( ls ); do
  echo item: $i
done
```


```bash
#!/bin/bash
# Basic for loop
names='Stan Kyle Cartman'
for name in $names
do
echo $name
done
echo All done
```


```bash
#!/bin/bash
# Basic range in for loop
for value in {1..5}
do
echo $value
done
echo All done
```


```bash
#!/bin/bash
# Basic range with steps for loop
for value in {10..0..2}
do
echo $value
done
echo All done
```



```bash
#!/bin/bash
# Make a php copy of any html files
for value in $1/*.html
do
cp $value $1/$( basename -s .html $value ).php
done
```

[Bash For Loop](https://www.howtouselinux.com/post/bash-for-loop-examples)

[What Is Bash in Linux?](https://www.howtouselinux.com/post/what-is-bash-in-linux)

[10 Bash for Loop In One Line Examples](https://www.howtouselinux.com/post/bash-for-loop-in-one-line)

[Linux Commands for Linux Beginners (Cheat Sheet)](https://www.howtouselinux.com/post/linux-commands-for-linux-beginners-cheat-sheet)
