The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-16-2008
hikrishn hikrishn is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 4
Smile How to use sed for string manipulation

Hi,

I would like to know How to use use sed for manipulating string for the following situation.
Basically my objective is to check validity of the filename in my shell script.
I am getting a parameter like this for my shell script.
Check my folder is having some space.

$1=/root/krishna mohan/file.txt

I am trying to use sed so that I can mutate the above file path like below and further use ls command.
/root/'krishna mohan'/file.txt

ls /root/'krishna mohan'/file.txt

Ofcourse I do know that I can use single quote in the begining and end.But I will have problems if I am getting above parameter with some mask/pattern like
/root/krishna mohan/file*.txt
Here keeping single quotes in the begining and end won't work.

Kindly suggest me the solution How to keep quotes for any text between / and / which has space.