You are not logged in.

#1 2008-12-21 10:57:56

Xauthority
Member
From: ../
Registered: 2008-11-03
Posts: 61

[Solved] Problem with BaSH

Hi fellows,
I am trying to make a script that helps me running complex WINE programs.
As a part of it there was this

PROGDIR="/store/wine/Prog\ Name/"
cd $PROGDIR

but here is the problem that cd returns
cd $PROGDIR
bash: cd: /store/wine/Prog\: No such file or directory

If I write it manually cd /store/wine/Prog\ Name/ it works.
Also it would work like this

PARENTPROGDIR="/store/wine/"
cd $PARENTPROGDIR/Prog\ Name/

It seems that when a dir Path with a space in the name comes from a variable breaks the whole thing.

Thanks for any help.

Last edited by Xauthority (2008-12-21 11:45:48)

Offline

#2 2008-12-21 11:03:12

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,400
Website

Re: [Solved] Problem with BaSH

cd "$PROGDIR"

or

PROGDIR="\"/store/wine/Prog\ Name/\""

Offline

#3 2008-12-21 11:42:18

Xauthority
Member
From: ../
Registered: 2008-11-03
Posts: 61

Re: [Solved] Problem with BaSH

Thanks for your quick responce Allan !
That worked for me big_smile

PS: How can I add solved to the topic

Offline

#4 2008-12-21 11:43:25

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,400
Website

Re: [Solved] Problem with BaSH

use the edit link in the bottom right of your first post

Offline

Board footer

Powered by FluxBB