Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Linux and Unix
Tag Cloud
access audio black screen blue screen boot bsod connection crash dell desktop drivers dvd email error excel firefox hard drive hardware hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem processor recovery registry cleaner router screen slow sound spyware tdlwsp.dll trojan upgrade vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Solved: ksh sed question

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
surfnschultz's Avatar
Senior Member with 191 posts.
 
Join Date: Nov 2003
23-May-2005, 05:46 PM #1
Solved: ksh sed question
I want to take the input data and make it look like the output data

Input data:

710013
710014
710015


output data:

710013
close
710014
close
710015
close

So my questino how to insert a return and the test close?

Thanks for any and all help.
Squashman's Avatar
Distinguished Member with 14,988 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
23-May-2005, 07:50 PM #2
I know there is a shorter way to do this, but I just couldn't figure it out, so this is what I came up with.

Code:
cat filename.txt | sed G | sed 's/^$/close/'
surfnschultz's Avatar
Senior Member with 191 posts.
 
Join Date: Nov 2003
24-May-2005, 12:27 PM #3
thank you squashman!!!
That was the trick I was looking for!!!!! you rock man!
Closed Thread Bookmark and Share

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 09:02 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.