defining variable in .profile


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers defining variable in .profile
# 1  
Old 07-12-2010
Network defining variable in .profile

In root dir i have created a .profile file and added variable and assigned a path to it:
a = '/dir/dir'
export a

but when i echo (echo $a) the path or use this variable the value or path not getting displayed.

i tried executing the .profile and logging out and logging in, didnt workout. am i missing out something in .profile or is it created in wrong path.?Smilie
# 2  
Old 07-12-2010
You didn't actually include the spaces between a, =, and ', did you? You can't have spaces when assigning a value to a variable.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Defining variable problem

Hi I'd say I'm having this weird problem where my script isn't taking the value off a variable or printing it. My code is like this: set count_C= `grep -c C mols` set count_H= `grep -c H mols` set count_O= `grep -c O mols` sed -i '7,7 s/$/ $count_C $count_O $count_H/g' input It... (8 Replies)
Discussion started by: saleheen
8 Replies

2. Shell Programming and Scripting

defining a variable using multiple "entries/columns" within a line using read

Hello All, I am trying to figure out how to use the read command. I have a txt file that has rows looking something like this: 1 2 3 4 5 6 7 8 9 where each number represents an entry of various characters deliminated by tabs. My goal is to set entries 2-7 as a variable/string that I... (3 Replies)
Discussion started by: Torinator
3 Replies

3. UNIX for Dummies Questions & Answers

Defining EDITOR Variable - Tru64

Hi, I have to edit a lot of partitions soon and wanted to do so with EMACS rather than VI. The "disklabel -e -r disknumber" command picks up VI as it's defined, but how do I set "-e" so it uses EMACS instead please? Thanks...! (2 Replies)
Discussion started by: Bagel08
2 Replies

4. AIX

rerun .profile after changing variable

I changed a $variable in my .profile (AIX unix). I know I could exit out and logon onto unix again, but how do I rerun the .profile at the command line? (2 Replies)
Discussion started by: sboxtops
2 Replies

5. AIX

Environment variable values encrption in profile

Hello This is the format of present profile which we use for a AIX user export DMRUNuser ; DMRUNuser="owbrunuser_10" export DMRUNpasswd ; DMRUNpasswd="ods$12345" DMRUNuser&DMRUNpasswd were the environmental users which store the user id and password of a... (1 Reply)
Discussion started by: kalpana.anuga
1 Replies

6. Shell Programming and Scripting

How is .profile and environment variable linked..

:( 1.) How is .profile and environment variable linked.? 2.) What happens when we execute a script.? (3 Replies)
Discussion started by: guhas
3 Replies

7. Solaris

Profile and environment variable

Hi, I'm using solaris 8 and I need to know where I can add the following variable to have it applied to all my user Ids. I tried to add this to /etc/profile but not working when i check with "env" command : export PW_MATRIX=/usr/local/ccms/security/dat/.PASSWORD_MATRIX export... (2 Replies)
Discussion started by: unclefab
2 Replies

8. UNIX for Dummies Questions & Answers

defining a variable as a number or character?

I am writing a script that needs to accept numbers into a variable by prompting and using the code read num case $num in 000) break ;; *) I am fairly new to unix and am loving the versatility of the language but need a little shove in the right... (1 Reply)
Discussion started by: noobian
1 Replies

9. UNIX for Dummies Questions & Answers

changed .profile but didnt ./.profile, yet reflected changes

hi , i added ls -F to .profile. and i need to do ./.profile for the effect to take effect BUT i didnt and YET the next day when i came to work and log in, the changes took effect. i am on aix. please explain.. thanks (4 Replies)
Discussion started by: yls177
4 Replies

10. UNIX for Dummies Questions & Answers

Modifying $PATH variable in /etc/profile

In my /etc/profile, my $PATH variable is set as follows: $PATH =/sbin:/usr/sbin:/usr/bin:/etc Then how do I add an additional directory to it? say /export/home/abd/rose Please advise. Thanks! Deepali (3 Replies)
Discussion started by: Deepali
3 Replies
Login or Register to Ask a Question