On Monday, 19 September 2022 at 10:50:36 UTC+1 princ...@gmail.com wrote:

>
> *search:=scanner.Text()cmd1,err:=exec.Command("bash", "-c", "find . -name 
> '*$search*'")*


You first "search" is a go local variable.
Your second "$search" is seen by the shell as a reference to an environment 
variable.

So if you want to do it that way, you need to set it in the environment, 
e.g. with os.Setenv.
https://pkg.go.dev/os#Setenv

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f7a8dc06-7c2e-4756-9082-d28460eab1den%40googlegroups.com.

Reply via email to