linux - Bash script that creates an Array from ls? -
i in process of creating bash script list files (in case apache sites-available). listing files easy ultimate goal take each of files array, display them user , allow user select "file" process, in case enable site.
i haven't gotten far, know need set ls array , loop action:
array=$(ls) sites in $array(2) echo "$sites" done
i know need index each of files in directory , allow user type number enable. this:
(1) newdomain.com (2) newdomain2.com site enable (i.e 1)?
hopefully makes sense?
that's not how use ls
.
array=(*)
Comments
Post a Comment