USB drive name with space

HI,

I am using Suse 10.0. and have external Seagate USB drive which I use it with my Window XP as well. When I booted up Suse, it recognize the drive as “FreeAgent Drive”. I can access using
command like
cd “FreeAgent Drive”
but my main app where I set my data directory in a shell script
something like
setenv DATA_DIR /media/“FreeAgent Drive”
but
cd $DATA_DIR
I got error “too many argument”

Any suggestion?

Pom

Hi
It’s either;


setenv DATA_DIR=/media/FreeAgent\ Drive
or if it's bash;
export DATA_DIR=/media/FreeAgent\ Drive


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.1 x86 Kernel 2.6.27.7-9-default
up 4:25, 2 users, load average: 0.28, 0.15, 0.09
GPU GeForce 6600 TE/6200 TE - Driver Version: 180.22

thanks,

bash command works but not csh

Are there commands in bash similar to “source” in csh

I need to set a lot of other variables in particular

/////////////////////////////////
set IDL_SETUP = /home/idl56/bin/idl_setup
if ( -e $IDL_SETUP ) then
source $IDL_SETUP
else
echo “ERROR: Unable to find $IDL_SETUP”
exit -1
endif
////////////////////////////////////

these IDL setting, I can really use some help in bash.

thanks for your time.

Hi


#!/bin/bash
IDL_SETUP=/home/idl56/bin/idl_setup
if  -e $IDL_SETUP ]; then
export IDL_SETUP
else
echo "ERROR: Unable to find $IDL_SETUP"
exit
fi


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.1 x86 Kernel 2.6.27.7-9-default
up 6:20, 2 users, load average: 0.34, 0.16, 0.10
GPU GeForce 6600 TE/6200 TE - Driver Version: 180.22

The source command in csh is the source command in bash also. You can also use the original name for source, which is . (a single dot).

If you are used to programming in csh and just want to get the script going quickly, you could continue to use it by putting

#!/bin/csh

at the top of the file instead of #!/bin/sh

But if you are going to do any amount of shell programming, then I would recommend learning bash since it’s the defacto standard shell in Linux now.

thanks,

It is a real mess now. My application still does not recognize this USB drive.

Any suggestion on how to change the drive label from
“FreeAgent Drive” to something sensible like USBDrive
without space?

thanks for all your help.

You should be able to change the drive label under YaST partitioner I think.

sailasuta schrieb:
> drive as “FreeAgent Drive”. I can access using
> command like
> cd “FreeAgent Drive”
> but my main app where I set my data directory in a shell script
> something like
> setenv DATA_DIR /media/“FreeAgent Drive”
> but
> cd $DATA_DIR
> I got error “too many argument”

Try

cd “$DATA_DIR”

and read up on shell variable substitution and quoting.

HTH
T.


Tilman Schmidt
Phoenix Software GmbH
Bonn, Germany