Foreach loop with Bash

Terminal

Loops around a directory and echos each folder.

 

Code

#!/bin/bash

cd /var/www/vhosts

for i in $( ls ); do
   echo $i
done