Ubuntu :: Where Is Environmental Variable Set / How Can I Get This Working?

Mar 19, 2011

I created some new accounts on a dev seat: Code: useradd -m newUser1.Users get created fine and can log in but are missing all the bash files (.bashrc, .bash_history, etc). When these users try to use the up and down arrows to view shell history they get junk characters. I checked and there is no history file in their homes. Where is the environmental variable set and how can I get this working?

View 1 Replies


ADVERTISEMENT

Ubuntu :: Unable To Set Environmental Variable (PATH) From Script

Jan 21, 2011

I am Just trying to set the Environmental variable using a script file and my code is as follows:

#!/bin/bash
echo $PATH
PATH=${PATH}:/opt/bin
export PATH
echo Environmental Variable path is Set
echo $PATH

When I am running the above script, from the last line "echo $PATH" I am getting that /opt/bin has been appended to the PATH but again when I am typing echo $PATH in the terminal I am not getting the newly appended path.

View 3 Replies View Related

General :: Make An Environmental Variable RPMS?

Apr 1, 2011

I'm trying to make an environmental variable RPMS that will resolve to a website. I know I have to make the changes in .bash_profile, but all the things I try don't seem to want to work.

I've tried:
PATH=$RPMS:ftp://rha-server/pub/os/rhel5/Server/
or simply just making the variable itself
$RPMS=ftp://rha-server/pub/os/rhel5/Server/

The second one made a variable just fine, but when I attempted to run this command:

rpm -ihv $RPMS/caching-nameserver*

View 5 Replies View Related

Programming :: Put A Name Which Contains Blank Into A Environmental Variable When Using Puten

Mar 28, 2011

Code:
/*[workhard@localhost BeginningLinuxProgrammingC3]$ echo new_value 1122
new_value 1122

It's ok when I add value"1122" to a new value. But how can I add value "11 22" to a new value.

#include <stdio.h>
#include<string.h>
#include <stdlib.h>
int main (int argc, char **argv)

[Code]....

View 2 Replies View Related

General :: Environmental Variable In Bash Command String?

Feb 9, 2011

I do this:

Code:

a@b:~$ export A=hi
a@b:~$ echo $A
hi
a@b:~$ bash -c "export A=blah; echo $A"
hi
a@b:~$

Why doesn't the bash command print the new value of $A? Is there a way to make it do so?

View 6 Replies View Related

General :: Installed Qt Libs - Set Environmental Variable PATH

Sep 5, 2010

I have bash. I installed Qt libs and want to set environmental variable PATH, I tried some stuff from qt tutorials..

Here is what i tried:

Code:

and it does nothing so i tried

Code:

then checked path

Code:

Now there are two issues
1) the make gives error that header not found( probably make don't have the path)

2) when i closed the terminal and opened it again the PATH I newly entered was not there !

View 3 Replies View Related

General :: Ubuntu Etc/profile: Environmental Variable Doesn't Display Content?

Jul 28, 2011

i am trying to declare an environmental variable in the /etc/profile' (as per the tutorial i'm following) but when i declare it and do an echo i get nothing.Here's what i've done so far..nside /etc/profile:

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ -d /etc/profile.d ]; then

[code]...

View 12 Replies View Related

Ubuntu :: Run Environmental Variables On A 10.04 LTS Home Server

Dec 24, 2010

I have installed ubuntu10.04 LTS in VirtualBox in my home computer(i forgot to tell you i am very new to linux-though i am studying a lot, but....-maybe because of my age "45" i am going slow. LOL. I hope i dont have a heart attack before i finish what i am trying to do in the server). Back to my issue: What i want is to have in the server some enviromental variables running not only for the root user but for all the users,when the server is open and not having to type the following commands every single time i open the terminal. Here are the commands:

export JAVA_HOME=/opt/java
export PATH=$JAVA_HOME/bin:$PATH
export M2_HOME=/opt/maven/maven
export PATH=$M2_HOME/bin:$PATH

[code]....

(where java, maven, tomcat are symbolic links for java jdk, maven and apache-tomcat 5.5.31). Please (LOL) save me from the heart attack, give me the chance to enjoy the holidays with my family!

View 4 Replies View Related

Ubuntu :: Reset Environmental Variables After Restart The System

Apr 15, 2010

I am new in Using Ubuntu, I need to set up environmental variables in Ubuntu, I do the following:

Code:
export JAVA_HOME=/path/to/Java
export PATH=$JAVA_HOME:$PATH

it work fine, but every time I restart the system I have to reset it again Is that the right way to it, or I do something wrong

View 2 Replies View Related

Ubuntu Installation :: No PATH Variable Set But Still Javac Working Fine

Jun 11, 2010

I thought that setting up the PATH variable was a must if we wanted to use java or javac commands on linux (preferably in the bashrc file), but I am able to use these commands anywhere without setting up the PATH variable.. Similarly, without specifying . in the CLASSPATH variable (in fact, not specifying the CLASSPATH variable at all), I am able to access class files in the same directory. How is it possible ?

View 1 Replies View Related

General :: Variable Expansion In .bashrc Not Working?

Feb 21, 2011

In my .bashrc file, I am attempting to set JAVA_PATH to a local path, using the HOME environment variable or '~' symbol as shown in the following examples.Using ${HOME}

export JAVA_PATH='${HOME}/Software/java/jdk1.6.0_24'

When I attempt to use ${JAVA_HOME} in a my ${PATH} javec is not found. To debug it, I tried a simple ls command:

ls ${JAVA_HOME}

and get the following error:

ls: ${HOME}/Software/java/jdk1.6.0_24/: No such file or directory

Using '~': Trying to use '~' symbol as follows:

export JAVA_PATH='~/Software/java/jdk1.6.0_24'

the ls command results in the same error, however javac is found.I prefer the '~' symbol anyway, but would like to understand why the ls command does not work for either, and why it seems as though ${HOME} is not being expanded.

View 2 Replies View Related

Programming :: BASH - If Variable -eq String Not Working ?

Jan 24, 2010

Here is the code:

Code:

How ever when I run this script I get the following error

Quote:

I just don't get it, I have racked my brain trying to figure out every combination of how I should write this if statement and I can't get it to work.

View 2 Replies View Related

Red Hat / Fedora :: Permanently Setting Environmental Variables?

Aug 6, 2010

I installed Java on a server and anytime I have to start or stop a service that requires the $JAVA_HOME variable I have to manually set it with the export command such as: Code: export JAVA_HOME=/usr/java-jdk1.6.0_21 How can I permanently set this variable?

View 3 Replies View Related

Software :: No PATH Variable Set But Still Javac Working Fine

Jun 11, 2010

I thought that setting up the PATH variable was a must if we wanted to use java or javac commands on linux (preferably in the bashrc file), but I am able to use these commands anywhere without setting up the PATH variable.. Similarly, without specifying '.' in the CLASSPATH variable (in fact, not specifying the CLASSPATH variable at all), I am able to access class files in the same directory. How is it possible ?

View 4 Replies View Related

General :: Bash Read All Environmental Variables Set By Other Shells?

Jul 23, 2010

For example, if I'm in csh, I can use `setenv VARNAME varVALUE` while I can use export in Bash. Given that the environmental variables are created, can BASH read env vars from csh and vice versa?

View 2 Replies View Related

Software :: Environmental Variables In BASH Source Code

Mar 17, 2011

My question has to do with how environmental variables are passed from parent to child processes at the BASH SOURCE CODE level. I have a need to add an environmental variable that has the complete invocation line so that the child process can see it via ENVP.I have been studying the source for a quite a while and can't seem to find how to make the variable pass to the child. In EXECUTE_CMD.c I found a good place to set the variable: I made a routine similar to PUT_COMMAND_NAME_INTO_ENV called PUT_COMMAND_LINE_INTO_ENV which would add "?=THE FULL INVOCATION LINE" as an environmental variable but it doesn't make it to the child. (I've tried names other than '?' but they don't work either.

I'm thinking that there is either a LIST or a attribute associated with those environmental variables that should be passed to the child but I can't find it.

View 1 Replies View Related

Ubuntu Servers :: Setting Up A Script That Ssh's Into Our Netapp (server01) And Then Reports An Environmental Chassis Status List-sensors

Jul 27, 2011

I'm looking at setting up a script that ssh's into our netapp (server01) and then reports an environmental chassis status list-sensors. being relatively new to programming I'm a little lost. I've gotten this far:

Quote:
#!/bin/bash
SERVER="server01"
USR="root"
OUT="out.txt"
ssh $USR@$SERVER > $OUT

View 4 Replies View Related

Programming :: Bash - Read Content Of File To Variable And Use This Variable In For Loop ?

Aug 21, 2009

I'm trying to read content of file to variable and use this variable in for loop. The problem is, when I have c++ comment style in file - /*. Spaces in line are also interpreted as separated lines.

For example:

Code:

Changing $files to "$files" eliminate these problems but causes that whole content of variable is treated as one string (one execution of loop).

View 6 Replies View Related

General :: Assign Local Variable Values To Global Variable?

Feb 17, 2011

how to assign a local variable value to a global variable....

View 2 Replies View Related

Programming :: Make A New Variable With The String From The Old Variable Btut Without Any Plus Sign?

Apr 7, 2010

my script has a variable which comes in the form +00.00 +0.00 -00.00 or -0.00 (the numbers can be any in that form) for any that have a + symbol I need to remove the +, but if it has a - symbol it needs to stay.

i need to make a new variable with the string from the old variable btut without any plus sign. I have tried a lot of different ways with no success, each thing I tried either left the + or removed the entire string. I think this should work but doesn't

foo=+12.40
bar=${foo#+}

View 4 Replies View Related

General :: Create An Environment Variable With The PRINTER Variable?

Apr 16, 2011

I am supposed to create an environment variable with the PRINTER variable, which should resolve to the word sales. Would the command be like this?: env PRINTER - NAME=SALES (is this the command to create that variable with resolving the word sales to it?)

View 3 Replies View Related

Software :: Get Variable From Text File Into Bash Variable?

Jun 10, 2009

I have a text file i that has a mailTo: NAME in it. In a bash script i need to extract NAME and put it in a $variable to use. How do i do this?

View 2 Replies View Related

Programming :: Search Within A Variable And Assign The Results To A New Variable?

Apr 25, 2011

how I can search within a variable and assign the results to a new variable. I'll use the following as an example -

cars="Audi BMW Cadillac Chevy Dodge Ferrari Ford Mercedes"
list=`echo ${cars} | egrep -o '<A?+|<C+'`

with the echo command I get the following output assigned to list -

A
C
C

What I'd like to get for output is -

Audi
Cadillac
Chevy

how I could do this regardless of upper/lower case letters?

View 5 Replies View Related

Programming :: Assign Value Of C Variable To Shell Variable?

Apr 28, 2010

included shell script inside c program, and i wanted to assign the value of c variable to shell variable..Can any one please suggest me how to do it?

View 8 Replies View Related

General :: Use The Value Of One Variable To Generate A Name For Another Variable?

Jul 25, 2010

can i use the value of one variable to generate a name for another variable? for example i want to use the counter from a "do while" loop to name and define a variable each time the loop executes. for example

objectnames1=`ls -a`
objectnames2=`ls -a`
etc.

i don't have a script yet but each time through the loop i intend to cd to a particular directory and then define a variable containing a list of each object in that directory as values. for the rest of the script to work, each variable generated has to be unique, and i can't think of a good way to accomplish this.

if using a value from one variable to name another isn't possible, can anyone think of a more elegant solution? i know limited syntax but i'm willing to read up...

View 6 Replies View Related

General :: Sed Substitution Of Variable With A Variable?

Dec 27, 2010

I am trying to alter the character position of residue numbers above 999 in a pdb file.The following script is an attempt to:1) Get all unique pdb residue numbers (in column 5) using awk and assign it to a variable i.2) Loop through all the values in $i and if it is greater than 999, shift that number one character to the right using sed.However, the script only manages to alter the final residue numberCould anyone please advise how I can loop through all values in $i and shift it one character to the right?

#!/bin/bash
# Script to alter position of residue number in pdb file for resid above 999
i=$(awk '{print $5}' wt-test.pdb | uniq)

[code]...

View 6 Replies View Related

Programming :: Assignment To A Variable Variable?

Mar 17, 2011

This loop is part of a bash script which takes multiple arguments.

Code:
for ((i=1;i<=$number;++i)) ; do
offset=$(($i+5))

[code]...

View 3 Replies View Related

General :: Bash - HISTSIZE - Readonly Variable -bash - HISTFILESIZE - Readonly Variable

Dec 8, 2009

On one of my servers I see this when I log in. What does this mean and how can I get it to go away? Everything seems to work fine, but none of my other machines give this error.

View 5 Replies View Related

Ubuntu :: Bash Variable And /bin?

Mar 28, 2010

I'm making a script I want to be able to just call (ie, rclick instead of ./rclick) where do I put it?

~/bin?
/bin?
/usr/bin?

Also, how do I pass a variable to the script (rclick 10 will rightclick 10 times) (Found, so simple... $1)Lastly, can I force it to run on CPU2? CPU1 is completley locked up if I run this on it... Or can I make it use less cpu cycles?

View 2 Replies View Related

Ubuntu :: How To Set Environment Variable

Jun 28, 2010

Well on a Rsps forum it says that the reason i keep crashing in the client is cause my Envieronment Variable isnt set for Java. i was wondering how to do this.please make it deatailed since i am new to ubuntu and i dont know most of the things like usr/java

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved