What is the equivalent of setenv in OPENSUSE bash shell?

| | https://groups.google.com/forum/clear.cache.gif
|—|
https://groups.google.com/forum/clear.cache.gif

4 hours (11:36 PM)
|

 Hi, 

I try to set environment variable for a software. On internet, I find this suggestion:

setenv XILINXD_LICENSE_FILE /opt/Xilinx/Xilinx.lic

After some web google, I know that setevn is for csh. I use bash in OPENSUSE. I try export. It echos:

linux-kx35:/opt/Xilinx # export XILINXD_LICENSE_FILE /opt/Xilinx/Xilinx.lic
bash: export: `/opt/Xilinx/Xilinx.lic’: not a valid identifier

Could you tell me how to set that in bash, OPENSUSE, 12.3, KDE?

Thanks,

Hi
Like this;


export XILINXD_LICENSE_FILE="/opt/Xilinx/Xilinx.lic"

then check;

echo $XILINXD_LICENSE_FILE
/opt/Xilinx/Xilinx.lic

You can add the export command to your ~/.bashrc file so when you login it is set.

export varname=value

Thank you. Last time, I added one line to ~/.bashrc. I added: “source settings32.sh” to ~/.bashrc. It went wrong (now I think that I did not give the right path for it to find the .lic file). Then, I commented that line. The catastrophe was OPENSUSE 12.3 booted, stayed my bash shell (but in purple color, not the regular black bash shell). No response to keystroke at all. The whole /home cannot be accessed. It halted there, no response to any key.

Could you tell me that I should work on this file (~/.bashrc) at what path in bash shell window? I don’t know whether it cares or not, but I do know it may be even worse than a kernel crash for an inappropriate editing on that file.

Both vi or Kwrite can do the editing?

Text editor is a text editor GUI or command line

Do you have auto login set up? You can turn it off in command line yast-system config edit - desktoop-displaymanager-autologin

What ever you put in that script went into a loop I guess

try another user

I am curious where ~/.bashrc is? What meaning of ‘~’, ‘~/’, or ‘~/.’?

Thanks.

Yes, I had auto login set up.

The PC had only one user/account. To avoid that happens, it is better to set up multiple user accounts? Thanks,

~/ is short hand you can use for your home ditrectory

./ force current directory useful if executing a script in the current directory that may have a similarly named file in the path

…/ is up one directory …/…/ is up 2

so ~/bashrc is the bash configuration file in your home directory

oops missed typed

~/.bashrc

the period in front of file name makes it a hidden file

I think it is better to login you don’t have to have multiple accounts but if you have multiple users yes it is better to have an account for each

Makes it easier to recover from little problem like you had since yo can go to a terminal from the login window press ctrl-alt-F1

Also make the system a little more secure from some random person turning it on

Note if someone knows what they are doing and has physical possession only encryption will keep them out

Thanks. I just try to add:

source /opt/Xilinx/14.6/ISE_DS/settings32.sh

to ~/.bashrc. The path is correct, but it has an error on next boot:

Call to Inusertemp failed (temporary directories full? check you installation)

Why does it have such an error for that “source …” liine? How can I make the ‘source …’ line automatic load? Thanks,

Maybe it overrides important system variables? That error message seems to come from KDE.

Could you please post the file /opt/Xilinx/14.6/ISE_DS/settings32.sh?

Here is the content. Could you see something relevant to the problem?

Copyright (c) 1995-2011 Xilinx, Inc. All rights reserved.

XIL_ARG_=$_
SETTINGS_FILE=.settings32.sh
XIL_SCRIPT_LOC=“/opt/Xilinx/13.2/ISE_DS”
if $# != 0 ]; then

The first argument is the location of Xilinx Installation.

Don’t detect the installation location.

XIL_SCRIPT_LOC=“$1”
else

XIL_SCRIPT_LOC should point to script location

if “$0” == “ksh” ]; then
XIL_SCRIPT_LOC_TMP_UNI=readlink -f ${XIL_ARG_}
else
XIL_SCRIPT_LOC_TMP_UNI=$BASH_SOURCE
fi
XIL_SCRIPT_LOC_TMP_UNI=${XIL_SCRIPT_LOC_TMP_UNI%/*}
if “$XIL_SCRIPT_LOC_TMP_UNI” != “” ]; then
if “$XIL_SCRIPT_LOC_TMP_UNI” == “settings32.sh” ]; then
XIL_SCRIPT_LOC_TMP_UNI=“./”
fi
XIL_SCRIPT_LOC_TMP_UNI=readlink -f ${XIL_SCRIPT_LOC_TMP_UNI}
if $? == 0 ]; then
XIL_SCRIPT_LOC=${XIL_SCRIPT_LOC_TMP_UNI}
fi
fi
unset XIL_SCRIPT_LOC_TMP_UNI
fi

common=“common”
newLst=“”

for i in /bin/ls "${XIL_SCRIPT_LOC}"
do
d=“${XIL_SCRIPT_LOC}/$i”
if -d “$d” ]; then
if $i != $common ]; then
newLst=“$newLst $i”
fi
fi
done
newLst=“$newLst $common”

XIL_SCRIPT_LOC_TMP_UNI=${XIL_SCRIPT_LOC}
for i in $newLst
do
d=“${XIL_SCRIPT_LOC_TMP_UNI}/$i”
sfn=“$d/$SETTINGS_FILE”
if -e “$sfn” ]; then
echo . “$sfn” “$d”
. “$sfn” “$d”
fi
done

Not really.

And how did you add it to ~/.bashrc? Could you post that file as well, please?

lnusertmp normally only really can fail if you don’t have access rights to /tmp or /var/tmp or your / partition is full.
So please check the following:

df -h
ls -l /tmp /var/tmp

The above problem happened when ‘source’ line is added as follows:

If you want to use a Palm device with Linux, uncomment the two lines below.

For some (older) Palm Pilots, you might need to set a lower baud rate

e.g. 57600 or 38400; lowest is 9600 (very slow!)

#export PILOTPORT=/dev/pilot
#export PILOTRATE=115200
source /opt/Xilinx/13.2/ISE_DS/settings32.sh
test -s ~/.alias && . ~/.alias || true
~

source /opt/Xilinx/13.2/ISE_DS/settings32.sh
can be run in a bash window, but it is problematic when it is added to ~/.bashrc

Thanks

Why not add it to the ~/.config/autostart folder? IMHO bashrc is not the place to run scripts from.

I just tried that and KDE still worked fine here.

But apparently settings32.sh sources another file called .settings32.sh, could you post that one as well?

And as Knurpht indicated, you could run the file from a different point.
I would recommend to set up KDE to run it on login:
“Configure Desktop”->“Launch and Shutdown”->Autostart. Click on “Add script…” and select that script.