quick newbie bash question


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting quick newbie bash question
# 1  
Old 01-25-2007
Data quick newbie bash question

I'm in .profile. I want to export a directory ( export MY_TOOL_HOME=/tools/my tool". Unfortunately for me, the directory I want to export to has a space in its name. So when I try to cd $MY_TOOL_HOME, i get a No such file or directory at the command line... thanks for the help
# 2  
Old 01-25-2007
try using quotes
Code:
cd "$MY_TOOL_HOME"

# 3  
Old 01-25-2007
tried double quotes .. didn't seem to work

here's exactly what i have in .profile:

export LASZLO_COMPILER_HOME="/tools/openlaszlo/OpenLaszlo Server 3.3.3/bin"

Now out at the command line

1 - source ~/.profile

2 - cd $LASZLO_COMPILER_HOME


bash: cd: /tools/openlaszlo/OpenLaszlo Server 3.3.3/bin: No such file or directory

now if i try to cd to tools/openlaszlo/"OpenLaszlo Server 3.3.3" from the command line, I can do this all day .. just not with variable ( cd $LASZLO_COMPILER_HOME )
# 4  
Old 01-25-2007
Quote:
Originally Posted by redsand9009
here's exactly what i have in .profile:

export LASZLO_COMPILER_HOME="/tools/openlaszlo/OpenLaszlo Server 3.3.3/bin"

Now out at the command line

1 - source ~/.profile

2 - cd $LASZLO_COMPILER_HOME


bash: cd: /tools/openlaszlo/OpenLaszlo Server 3.3.3/bin: No such file or directory

now if i try to cd to tools/openlaszlo/"OpenLaszlo Server 3.3.3" from the command line, I can do this all day .. just not with variable ( cd $LASZLO_COMPILER_HOME )
Did you try using quotes around the variable?
Code:
cd "$LASZLO_COMPILER_HOME"

If you use quotes around the variable then it should work
# 5  
Old 01-25-2007
:)

sweet. yes, that worked ..thank you! sorry, i misunderstood the answer before ..

out of curiosity .. what are the double quotes around the variable telling bash to do ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Quick Bash question.

Hi, I'm basically looking to see what this line of code does: . `dirname $0`/../config/config Thanks. (1 Reply)
Discussion started by: cabaiste
1 Replies

2. Shell Programming and Scripting

Quick question: calling c-shell script from bash

Hello, I have a quick reference question: I have a very long, but fairly straigtforward script written in c-shell. I was wondering if it is possible to call this script from bash (for ex. having a function in bash script which calls the c-shell script when necessary), and if so, are there any... (1 Reply)
Discussion started by: lapiduslost
1 Replies

3. Shell Programming and Scripting

Quick bash question

I need to speed up this process. I would like for this script to spawn a sub-process for each line it reads and move on to the next without waiting for the data to be returned. I know with a large list this can be dangerous and eat system resources. However I use this script only when I get a... (7 Replies)
Discussion started by: Garlandxj08
7 Replies

4. Shell Programming and Scripting

perl newbie . &&..programming newbie (question 2)

Hello everyone, I am having to do a lot of perl scripting these days and I am learning a lot. I have this problem I want to move files from a folder and all its sub folders to one parent folder, they are all .gz files.. there is folder1\folder2\*.gz and there are about 50 folders... (1 Reply)
Discussion started by: xytiz
1 Replies

5. UNIX for Dummies Questions & Answers

UNIX newbie NEWBIE question!

Hello everyone, Just started UNIX today! In our school we use solaris. I just want to know how do I setup Solaris 10 not the GUI one, the one where you have to type the commands like ECHO, ls, pwd, etc... I have windows xp and I also have vmware. I hope I am not missing anything! :p (4 Replies)
Discussion started by: Hanamachi
4 Replies

6. UNIX for Dummies Questions & Answers

quick question

from command prompt I did grep two words on a same line for eg: grep abc | grep xyz and I got tht particular line, but I want to know when I vi that file how to directly search for that particular line? I appreciate if any one can provide answer, thanks in advance (2 Replies)
Discussion started by: pkolishetty
2 Replies

7. UNIX for Dummies Questions & Answers

Another quick question

Hi guys sed -e "s/$<//g" the $< can allow me to assign an input value to the variable right? do the double quotes check the previous context? (1 Reply)
Discussion started by: hamoudzz
1 Replies

8. UNIX for Dummies Questions & Answers

quick question

hi guys trying to understand what this line means sed is a stream editor and i understand that, i have a file already selected i want to edit so i use -e sed -e the next stesp is s/$* s is a subsititute replacement sed -e s/$*//g $ is in reference of the last line /g makes it... (2 Replies)
Discussion started by: hamoudzz
2 Replies

9. UNIX for Dummies Questions & Answers

Quick Question

Hello There! I am trying to write this SIMPLE script in Bourne Shell but I keep on getting syntax errors. Can you see what I am doing wrong? I've done this before but I don't see the difference. I am simply trying to take the day of the week from our system and when the teachers sign on I want... (7 Replies)
Discussion started by: catbad
7 Replies

10. UNIX for Dummies Questions & Answers

A Quick Question

Wat is the difference between the cp mv ln etc in /usr/sbin/static and cp mv ln functions in /usr/bin (4 Replies)
Discussion started by: DPAI
4 Replies
Login or Register to Ask a Question