mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Frank Wunderlich <>
To: Sascha Hauer <>
Cc: Ahmad Fatoum <>,
Subject: Aw: Re: Re: barebox extending boot-scripts
Date: Sat, 29 Jan 2022 11:40:08 +0100	[thread overview]
Message-ID: <trinity-eba130ad-1bd5-46a1-95bd-4a2ee29c1f96-1643452807981@3c-app-gmx-bs07> (raw)
In-Reply-To: <>

> Gesendet: Donnerstag, 06. Januar 2022 um 09:08 Uhr
> Von: "Sascha Hauer" <>

> It works for example with:
> for i in /mnt/sd.1/extlinux/Image*; do basename $i b; echo $b; done

this works with full path, but not if using a var for dir var

barebox@BPI R2PRO:/ i=0;for f in /mnt/sd.1/extlinux/Image*; do basename $f b; echo "$i:$b";let i++; done
barebox@BPI R2PRO:/ imgdir=/mnt/sd.1/extlinux/
barebox@BPI R2PRO:/ i=0;for f in $imgdir/Image*; do basename $f b; echo "$i:$b";let i++; done

basename - strip directory and suffix from filenames

Usage: basename PATH VAR

Remove directory part from the PATH and store result into variable VAR.

barebox@BPI R2PRO:/

any idea how to get it working with variable path?

i can do a cd before and drop the basename

cd $imgdir
for f in Image*; do echo $f;done

but then i need to restore the path again (something like prevdir=$(pwd);cd $prevdir) if script fails

regards Frank

barebox mailing list

  parent reply	other threads:[~2022-01-29 10:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 15:20 Frank Wunderlich
2022-01-05 16:07 ` Ahmad Fatoum
2022-01-05 18:13   ` Aw: " Frank Wunderlich
2022-01-06  8:08     ` Sascha Hauer
2022-01-06 12:41       ` Aw: " Frank Wunderlich
2022-01-07 13:07         ` Sascha Hauer
2022-01-07 16:42           ` Aw: " Frank Wunderlich
2022-01-10  9:42             ` Sascha Hauer
2022-01-15 13:47               ` Aw: " Frank Wunderlich
2022-01-17  8:59                 ` Sascha Hauer
2022-01-29 10:40       ` Frank Wunderlich [this message]
2022-01-31 11:03         ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-eba130ad-1bd5-46a1-95bd-4a2ee29c1f96-1643452807981@3c-app-gmx-bs07 \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox