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

Re: script



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 digitree org


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