help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Looping through files


From: Leslie Rhorer
Subject: RE: Looping through files
Date: Tue, 6 Sep 2011 12:45:19 -0500

Have you tried:

        while read dir_name
        do
                echo $dir_name
        done < <( ls /boot/* )

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Jason
But
Sent: Tuesday, September 06, 2011 2:50 AM
To: address@hidden
Subject: Looping through files

Hello all

I am trying to make a sort-of complicated grub.cfg file where I want to
search a series of files on the disk.

At first I tried something like

for dir_name in /boot/* ; do
 echo $dir_name
 read
done

But this just printed "/boot/*"

Then I trid

for dir_name in `ls /boot` ; do
 echo $dir_name
 read
done

But this printed "`ls" and then "/boot`"

Obviously what I want to achieve is more than printing information but for
now I want to get the looping code right.

My question is: Is there any way to assign a list of files/directories to a
variable dynamically and/or use it in a loop like this?

Thanks

Jason

_______________________________________________
Help-grub mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-grub




reply via email to

[Prev in Thread] Current Thread [Next in Thread]