LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 11: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, 11:59 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
Simply escape them with backslashes, e.g.
Code:
\ \ \ abcde
 
Old 11-05-2007, 12:00 PM   #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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:26 AM
Add spaces to a file using bash orfeo Linux - Newbie 5 05-28-2007 11:34 AM
Inserting spaces using SED/AWK ? aravindts Programming 4 09-29-2006 06:28 AM
Problem with SED and blank spaces BigLarry Programming 2 06-10-2004 05:57 AM
Spaces on command line odd Linux - Software 2 05-22-2004 09:17 AM

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

All times are GMT -5. The time now is 08:07 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