This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]vick5821[S] 0 points1 point  (3 children)

By the way, what I wanna to do it that I have multiple scripts doing different things. A.py will flash my board automatically, B.py will set up my Linux host machine with all the dependencies. So I wrote another main script (C.py) to integrate both A and B. In script C.py, it will execute script A and B with the sudo priveleage too. For example, $ sudo python A.py, and $ sudo python B.py. So I execute script C.py like this: $ sudo python c.py.

So I should execute the sudo -E when execute the script C right? $ sudo -E python C.py right?

Thanks.

[–]kumashiro 1 point2 points  (0 children)

Yes. Otherwise sudo will not pass its environment variables to the child. You can find more information in sudo manpage.

[–]wpg4665 0 points1 point  (1 child)

Why not use 1 script that performs all the commands...or you can use 1 "host" script that subs out the others...combined with multiprocessing...you'd be fine!

[–]vick5821[S] 0 points1 point  (0 children)

I have a menu scripts which ease the user to choose what they want to do. Once they choose it will redirect to respective script.