0
votes
1answer
21 views

variable.sh is not exporting the variable using terminal

I want to export many paths using a .sh script. after running it nothing is exported I don't know why. so if anyone can advise. This is the script used: #!/bin/bash txtrst=$(tput sgr0) # Text reset ...
0
votes
1answer
75 views

Bash script not adding variables to session [duplicate]

I have a bash script that I have added as a startup application. It does a bunch of exports and alias assignment. #! /bin/bash alias devhm='cd ${DEV_HOME}; ll'; alias wlhm='cd ${WL_HOME}; ll'; alias ...
1
vote
1answer
179 views

Bash script doesn't execute command from PATH

I have this simple script: #!/bin/bash echo ${HADOOP_HOME} $(hadoop fs -ls) The output is: /opt/hadoop-0.20.2-cdh3u2 ./hello.sh: line 3: Found: command not found So bash definitely sees ...
1
vote
1answer
1k views

NDK_ROOT enviroment variable defined but script does not see it

In my ~/.bashrc i have this: export ANDROID_SDK=~/Devel/android_dev_x64/sdk export ANDROID_NDK=~/Devel/android-ndk-r9d export NDK_ROOT=$ANDROID_NDK export ...
1
vote
1answer
265 views

Call shell script “inline” in another shell script

So the bottom line here is that I am trying to have one go-to script work to set environment variables (let's call it setenv.sh) that will be used in subsequent scripts. In Windows (I know, that is a ...
1
vote
1answer
151 views

Multiple possible interpreters in a shebang?

Trying to learn me some nodejs, I installed npm and the learnyounode module. Unfortunately, learnyounode tries to execute #!/usr/bin/env node and not #!/usr/bin/env nodejs -- as we have it setup in ...
1
vote
2answers
58 views

How to get the directrory name in shell script

I have a script which sets some environment variable to paths: export VAR1=/home/xyz/DIR_IN_WHICH_THIS_FILE_EXISTS export VAR2=$VAR1/abc/qwe ... Can I use something to get the ...
0
votes
1answer
121 views

Set command can't handle lines constituting of a \n (word/line counting script)

I have a problem with execution of a while loop, I have found out that the problem involves the execution of the set command, the assigment of the \n character to an environmental variable ...
0
votes
2answers
823 views

How to Import a Variable from a Script?

I want to get a variable from another script, as demonstrated in http://stackoverflow.com/questions/5228345/bash-script-how-to-reference-a-file-for-variables However, the answer uses source command ...
4
votes
2answers
3k views

How to pass results of bc to a variable

I'm writing a script and I would like to pass the results from bc into a variable. I've declared 2 variables (var1 and var2) and have given them values. In my script I want to pass the results from ...
1
vote
2answers
360 views

Why is sudo bash different from regular bash

Problem description : I am using something called play framework in my development which requires me to make the python script play available in the path. Hence I create a symbolic link in ...
3
votes
3answers
2k views

Cannot use “./” to execute a shell script

Maybe someone here would be able to help me out. Have installed Ubuntu 12.04 LTS (kubuntu) on two machines. The .bashrc and .bash_profile files are identical as the file structures on each machine is ...
8
votes
2answers
2k views

Is there a difference between “.” and “source” in bash, after all?

I was looking for the difference between the "." and "source" builtin commands and a few sources (e.g., in this discussion, and the bash manpage) suggest that these are just the same. However, ...
0
votes
1answer
2k views

How do you unset an environmental variable using a script?

If I have HTTP_PROXY defined in default my environment (by ~/.bash_profile), how can I unset the variable from a script? I know that I can do unset HTTP_PROXY from the command line, but if I try to ...
2
votes
3answers
384 views

What other bash variables are available during execution such as $USER that can assist on my script?

This is related to question 19245, in that one of the responders answered the question in an awesome way, and very VERY clear to any newbie. Now here is a question that i can't seem to figure. i ...