Questions tagged [environment]

The O/S in which a process is executed, especially settings that affect the process

A computing environment consists of the following items:

  • Server hardware
  • Operating system
  • Software (both the software being used, and supporting software, such as and )
  • Data (input/output) from the software
  • Environment settings, such as executable PATH search directories

Commonly, for software development there are three main groups of environments:

2384 questions
379
votes
11 answers

How do I run a program with a different working directory from current, from Linux shell?

Using a Linux shell, how do I start a program with a different working directory from the current working directory? For example, I have a binary file helloworld that creates the file hello-world.txt in the current directory. This file is inside…
Anton Daneyko
  • 5,778
  • 5
  • 26
  • 49
329
votes
3 answers

Changing default shell in Linux

How is it possible to change the default shell? The env command currently says: SHELL=/bin/tcsh and I want to change that to Bash.
mahmood
  • 19,156
  • 36
  • 118
  • 190
286
votes
2 answers

Java system properties and environment variables

What's the difference between system properties System.getProperties() and environment variables System.getenv() in a JVM?
Praveen Sripati
  • 29,779
  • 15
  • 74
  • 108
257
votes
15 answers

Using Pip to install packages to Anaconda Environment

conda 4.2.13 MacOSX 10.12.1 I am trying to install packages from pip to a fresh environment (virtual) created using anaconda. In the Anaconda docs it says this is perfectly fine. It is done the same way as for virtualenv. Activate the…
jeffery_the_wind
  • 13,565
  • 31
  • 87
  • 146
209
votes
16 answers

Change the current directory from a Bash script

Is it possible to change current directory from a script? I want to create a utility for directory navigation in Bash. I have created a test script that looks like the following: #!/bin/bash cd /home/artemb When I execute the script from the Bash…
artemb
  • 8,523
  • 9
  • 42
  • 68
176
votes
17 answers

Best general SVN Ignore Pattern?

What is the best (or as good as possible) general SVN ignore pattern to use? There are a number of different IDE, editor, compiler, plug-in, platform, etc. specific files and some file types that "overlap" (i.e. desirable for some types projects…
159
votes
4 answers

Java current machine name and logged in user?

Is it possible to get the name of the currently logged in user (Windows/Unix) and the hostname of the machine? I assume it's just a property of some static environment class. I've found this for the user name com.sun.security.auth.module.NTSystem…
Omar Kooheji
  • 50,943
  • 65
  • 176
  • 234
154
votes
6 answers

Can you get DB username, pw, database name in Rails?

I'm writing a rake task that does some DB work outside of Rails/ActiveRecord. Is there a way to get the DB connection info (host, username, password, DB name) for the current environment as defined in database.yml? I'd like to get it so I can use it…
Ethan
  • 52,651
  • 60
  • 180
  • 231
149
votes
11 answers

How do I get the path of a process in Unix / Linux

In Windows environment there is an API to obtain the path which is running a process. Is there something similar in Unix / Linux? Or is there some other way to do that in these environments?
lsalamon
  • 7,574
  • 5
  • 46
  • 60
136
votes
4 answers

About .bash_profile, .bashrc, and where should alias be written in?

Possible Duplicate: What's the difference between .bashrc, .bash_profile, and .environment? It seems that if I use alias ls='ls -F' inside of .bashrc on Mac OS X, then the newly created shell will not have that alias. I need to type bash again…
nonopolarity
  • 130,775
  • 117
  • 415
  • 675
133
votes
14 answers

Best way to create custom config options for my Rails app?

I need to create one config option for my Rails application. It can be the same for all environments. I found that if I set it in environment.rb, it's available in my views, which is exactly what I want... environment.rb AUDIOCAST_URI_FORMAT =…
Ethan
  • 52,651
  • 60
  • 180
  • 231
133
votes
7 answers

PowerShell: Setting an environment variable for a single command only

On Linux, I can do: $ FOO=BAR ./myscript to call "myscript" with the environment variable FOO being set. Is something similar possible in PowerShell, i.e. without having to first set the variable, call the command, and then unset the variable…
miracle2k
  • 22,364
  • 17
  • 60
  • 62
130
votes
7 answers

What's the difference between .bashrc, .bash_profile, and .environment?

I've used a number of different *nix-based systems of the years, and it seems like every flavor of Bash I use has a different algorithm for deciding which startup scripts to run. For the purposes of tasks like setting up environment variables and…
Adam Rosenfield
  • 360,316
  • 93
  • 484
  • 571
127
votes
1 answer

mysqli_fetch_assoc() expects parameter / Call to a member function bind_param() errors. How to get the actual mysql error and fix it?

In my local/development environment, the MySQLi query is performing OK. However, when I upload it on my web host environment, I get this error: Fatal error: Call to a member function bind_param() on a non-object in... Here is the code: global…
siopaoman
  • 1,423
  • 2
  • 11
  • 7
107
votes
9 answers

How can I get the current user directory?

Using this: Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) I get this output: "C:\\Documents and Settings\\[USER]\\Application Data" How can I get the root directory of all users? i.e.: "C:\\Documents and Settings\\[USER]\\"
juan
  • 74,179
  • 49
  • 153
  • 188
1
2 3
99 100