Re: [go-nuts] Pass variables to bash

2017-02-02 Thread Shawn Milochik
You can set environment variables in an exec.Cmd: https://golang.org/pkg/os/exec/#Cmd % cat example.sh #!/usr/bin/env bash echo "The password is $password." % export password=old_password % bash example.sh The password is old_password. % cat example.go package main import ( "fmt" "os" "os/ex

[go-nuts] Pass variables to bash

2017-02-02 Thread Rich
Hi All, My dev team did a very bad thing and issued lots of scripts that they wrote source a file that is in clear text which contains usernames / passwords etc. Without having to re-write a ton of existing bash scripts, I wanted to use Go and have that set the usernames / passwords and introd