Web lists-archives.com

[Mingw-users] How do I grab a variable set via shell?




Here's my code snippet:

HEAD_PATH:=$(WKSDIR).git$(DIRSEP)logs$(DIRSEP)HEAD
$(info PATH=$(HEAD_PATH))
HEAD_SAFEP:=$(subst \,\\,$(HEAD_PATH))
$(info SAFEP=$(HEAD_SAFEP))
HEAD_COUNT_STR:=$(shell find /c " +" $(HEAD_PATH))
VARBEG:=%
VAREND:=%
$(info COUNT_STR=$(HEAD_COUNT_STR))
# % ignores case so we don't need to go out of our way to convert our path to
# uppercase however it only works in patsubst which ignores the ----------
# before the path so we get subst to remove the left over leaving the number we
# wanted
sh_let:=set /a
HEAD_COUNT:=$(subst ---------- ,,$(patsubst %:,,$(HEAD_COUNT_STR)))
$(info COUNT=$(HEAD_COUNT))
HEAD_NMONE_STR:=$(shell $(sh_let) math_result=$(HEAD_COUNT)-1)
HEAD_NMONE:=$(shell echo $(math_result))

$(info NMONE=$(HEAD_NMONE))
HEAD_LASTL:=$(shell more +$(HEAD_NMONE) $(HEAD_PATH))
$(info LASTL=$(HEAD_LASTL))

I also highlighted the key snippet, I eventually figured out how to perform arithmetic without extra programs being installed but I still have the issue of grabbing the result to confirm it worked correctly, does anyone have experience of this sort of thing?
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe