LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-05-2007, 10:52 AM   #1
reconcil
LQ Newbie
 
Registered: Nov 2007
Posts: 5

Rep: Reputation: 0
How to add some spaces in sed command?


I want insert a sentence like this " (3spaces)abcdefg",but how to show the space in sed command?? thanks for your answers.
 
Old 11-05-2007, 10:59 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Simply escape them with backslashes, e.g.
Code:
\ \ \ abcde
 
Old 11-05-2007, 11:00 AM   #3
poet_imp
LQ Newbie
 
Registered: Nov 2007
Location: Tucson, AZ
Distribution: Kubuntu/Gutsy
Posts: 26

Rep: Reputation: 15
I am not clear what you are trying to do from your post. However, spaces are just like any other character. You would just include them in your "/ /". If you are doing it from the command line make sure your string is inside quotes.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sed add , before .[0-9] donnied Programming 7 10-02-2007 02:26 AM
Add spaces to a file using bash orfeo Linux - Newbie 5 05-28-2007 10:34 AM
Inserting spaces using SED/AWK ? aravindts Programming 4 09-29-2006 05:28 AM
Problem with SED and blank spaces BigLarry Programming 2 06-10-2004 04:57 AM
Spaces on command line odd Linux - Software 2 05-22-2004 08:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration