Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.

${} translation

৩১টি ভিউ
প্রথম অপঠিত মেসেজটিতে চলে আসুন

ruben safir

পড়া হয়নি,
১৩ ডিসে, ২০১৭, ৮:০৮:৩৬ PM১৩/১২/১৭
প্রাপক
_pkgname=${pkgname%-*}

What exactly does this do?

It comes from this uri
https://wiki.archlinux.org/index.php/Dynamic_Kernel_Module_Support#PKGBUILD

Lew Pitcher

পড়া হয়নি,
১৩ ডিসে, ২০১৭, ৮:৪৩:২৮ PM১৩/১২/১৭
প্রাপক
ruben safir wrote:

> _pkgname=${pkgname%-*}
>
> What exactly does this do?

It sets parameter $_pkgname with a value derived from the parameter $pkgname

The shell will expand ${pkgname%-*} into a string containing all the
characters from the expansion of $pkgname stopping at (and not including)
the rightmost hyphen and any characters that follow it.

For example, if
$pkgname
expands to "abc-def-ghi" then
${pkgname%-*}
expands to "abc-def"

[snip]

--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

Thomas 'PointedEars' Lahn

পড়া হয়নি,
১৩ ডিসে, ২০১৭, ১১:১৮:৪৭ PM১৩/১২/১৭
প্রাপক
RTFM.

--
PointedEars

Twitter: @PointedEars2
Please do not cc me. /Bitte keine Kopien per E-Mail.

Barry Margolin

পড়া হয়নি,
১৩ ডিসে, ২০১৭, ১১:২৮:৪৩ PM১৩/১২/১৭
প্রাপক
In article <p0siue$br8$1...@reader2.panix.com>,
Read the "Parameter Expansion" section of the Bash manual to see the
meaning of all the variations on ${variable}

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

Tobiah

পড়া হয়নি,
৪ জানু, ২০১৮, ৫:৩৫:০৬ PM৪/১/১৮
প্রাপক
On 12/13/2017 08:18 PM, Thomas 'PointedEars' Lahn wrote:
> ruben safir wrote:
>
>> _pkgname=${pkgname%-*}
>>
>> What exactly does this do?
>>
>> It comes from this uri
>>
> https://wiki.archlinux.org/index.php/Dynamic_Kernel_Module_Support#PKGBUILD
>
> RTFM.
>

I don't have any problem with questions that could be
answered by reading the very long (and often difficult to search)
bash man page. The straight answer would make better reading
for me, although I did enjoy your insight here.

Thomas 'PointedEars' Lahn

পড়া হয়নি,
৪ জানু, ২০১৮, ৬:১৮:৪৫ PM৪/১/১৮
প্রাপক
Nobody cares.

David W. Hodgins

পড়া হয়নি,
৪ জানু, ২০১৮, ৭:১০:৪৮ PM৪/১/১৮
প্রাপক
On Thu, 04 Jan 2018 17:34:59 -0500, Tobiah <to...@tobiah.org> wrote:

> On 12/13/2017 08:18 PM, Thomas 'PointedEars' Lahn wrote:
>> ruben safir wrote:
>>> _pkgname=${pkgname%-*}
>>> What exactly does this do?

Quickest way to find out is to try it ...

[dave@x3 ~]$ pkgname="xxx-yyy-zzz"
[dave@x3 ~]$ echo ${pkgname%-*}
xxx-yyy

So in this case it strips the last matching string ("-" in this case)
and everything after it.

Regards, Dave Hodgins

--
Change dwho...@nomail.afraid.org to davidw...@teksavvy.com for
email replies.
0টি নতুন মেসেজ