script

Kaushal Shriyan kaushalshriyan at gmail.com
Mon May 22 07:15:04 UTC 2006


On 5/22/06, Daniel Hedlund <daniel at digitree.org> 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 at digitree.org
>
> --
> fedora-list mailing list
> fedora-list at redhat.com
> 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




More information about the users mailing list