is there any way to see all external environment variables in scons [closed] - scons

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am new to scons please help regarding this query
I want to see all external environment variable values that are present environment in scons build model
how to check external environment values are set or not

SCons has three concepts of environment
External environment, mostly not used by SCons, and available as Python os.environ. If necessary, you can pull in values from here in your build scripts.
Construction environment, which is full of the things that are set up for SCons' own use. Once you've created one of these via, for example env = Environment(), its values can be looked at by doing env.Dump() which does a little formatting on it, or just by accessing env as a Python dictionary.
External environment, which is the values that will be passed as the environment to those processes, such as compilers, that are spawned by SCons. For a given construction environment env, those values are in env['ENV']

Related

View source code inside linux mint or any other distro [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 days ago.
Improve this question
I have an assignment in my OS design course and my instructor has asked us to open and view the source code of any of the functions (like the source code of copy or paste, something like that) of the kernel of our choosen linux distro.
I have searched a lot but I coudent find a way to do that from the terminal. Is there a way to do this via the terminal?
Searching on google keeps leading to websites that have the kernel source code
Here is the source code of GNU's core utilities. The source code won't be available from your own machine, there is no need to have uncompiled code. But you could use a C decompiler to watch it. These programs are usually located under /usr/bin

How to Create Custom Command in Linux? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm new to Linux and I'm wondering if I can create custom Linux commands:
For Example
LearningPhase1 cpu getinfo
To show similar output as we get from lscpu command
LearningPhase1 memory getinfo
to get memory information of my Computer
Also, I want to know if I can create new user using my own custom command
LearningPhase1 user create <username>
To create new user
LearningPhase1 user list
To get all the users of my computer
LearningPhase1 user list --sudo-only
To get the users with sudo permissions
This is my question on stackoverflow.
Any Link, Material, or Help regarding this will be much appreciated.
Please Help me in Learning more about these things.
Linux shells looking for programs which are stored in Specific Locations and if there is a program named LearningPhase1, they execute it as command.
you have to write your program and put its binaries or its code (if its interpreted) in those specific location.
you can view those specific locations with this:
echo $PATH

Which one is good to use - Zoidberg or Term::Shell ( Perl Modules ) to implement the customize shell in Perl? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am going to write the code for my own shell which has some customized commands and i want to code it in Perl. I have found two modules on CPAN which can help me for the same.
1) Term::Shell ( http://search.cpan.org/~shlomif/Term-Shell-0.06/lib/Term/Shell.pod )
2) Zoidberg ( https://metacpan.org/pod/Zoidberg )
Which module shall i use for the implementation?
Is Term::Shell older then Zoidberg and lacking features then Zoidberg?
OR is there any other module which can help me better?
It depends what you want.
If you want something a bit like a Unix shell, with built in commands like cd, and that will launch external programs like Firefox just by typing firefox, which you can then customize to add your own commands, then go with Zoidberg.
If you want to start with a blank slate and create your own commands so that you have a shell that just includes what you want and nothing else, then go with Term::Shell.
Personally though for the latter case, I'd use App::Cmd and write each command that I wanted my shell to support as an App::Cmd subcommand of my app. Then use an approach like this to add an interactive shell.

Is it a good idea to use global variables to store DB handles in a Go web application? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Official guide says it's okay to use a global variable to cache templates:
http://golang.org/doc/articles/wiki/
First we create a global variable named templates, and initialize it
with ParseFiles.
Can global variables be used to store DB handles and repository objects? Or do they have to be initialized for every request?
Thanks a lot
Yes, that's perfectly fine, it's used in the official Go packages all over the place, now if you gonna modify these objects from your handlers, you will have to use a mutex so you wouldn't run into races.

How do I modify the configuration file in Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I have a file stat.config -
[stat=1]
name=value
name=value
[stat=2]
name=value
name=value
And I have a script file scr.sh which is required to update the config file by finding the context and appending data only in the above contexts.
How can this be done ?
Normally I like to answer questions as asked, but this time I strongly recommend you do not use a shell script for this. Shell scripts are good for simple tasks, but they are delicate. If there is a bug in your script you will delete or corrupt your config file.
Better to use a more powerful language like Python, Perl or Ruby. Python's configparser library seems to do exactly what you want. If I am reading the docs correctly, you can do:
config = configparser.ConfigParser()
config.read('example.ini')
config['stat2']['flame'] = "42"
with open('example.ini', 'w') as configfile:
config.write(configfile)
The nice thing about this is that if the program fails while you are editting config, then nothing will be written, so there is less danger of currupting your file.
The other languages I named probably have equally good solutions.

Resources