-
Hi everyone 👋 😋 The setupi've got the following $ cat Makefile
VAR=default
target:
@echo "VAR: ${VAR}" What happensall of the following work as expected 👌 $ make target
VAR: default
$ make target VAR=
VAR:
$ make target VAR=foo
VAR: foo i would like to use environment variable inside $ make target VAR=$env.PWD
VAR: nv.PWD
$ make target VAR=$"($env.PWD)"
VAR:
$ make target VAR=($env.PWD)
VAR: (nv.PWD) even though $ echo $env.PWD
/home/ants What i wanted to doI wanted to have a behaviour similar to what can be done in $ bash
$ make target VAR=$PWD
VAR: /home/ants My questionmaybe i've missed something in the anyways, cheers 😉 🎉 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Maybe try make target |
Beta Was this translation helpful? Give feedback.
Maybe try make target
$"VAR=($env.PWD)"
. You probably want to sendVAR=/foo/bar/baz
tomake target
, right? From Nushell's point if view it's just a string. It doesn't know that it's supposed to be variableVAR
with assigned value/foo/bar/baz
, that's the external command's job to interpret. Our string building is also different from bash etc. so that's why your attempts didn't work.