#!/bin/bash c=0; for i in $( ls ); do array[$c]=\'$i\'; let c=c+1; echo $c done for i in $array; do echo $i done