Re: script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/22/06, Daniel Hedlund <daniel@xxxxxxxxxxxx> wrote:
Kaushal,

> va=`cut -d"/" -f2 out`
> cd $va
>
> The issue is that it doesnot cd to the directory after running the
> script means
> cd sab.
Do you have any spaces in any of the directories that you're trying to
cd to?  If so, this could be your problem; you'll need to escape the
variable (cd "$va" for example).  This isn't the best way to handle
escaped characters but works as long as filenames don't have any
quotation marks in them.  How are you generating the file "out"?  If
it's using a command like 'ls', you can add "-Q" or "--quote-name" to
the command which will automatically escape the paths.

Cheers,

Daniel Hedlund
daniel@xxxxxxxxxxxx

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list


Hi Daniel

Now the script looks like

#!/bin/bash

va=`cut -d"/" -f2 out`
echo $va
cd "$va"

But didnot worked for me

Kaushal


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux