Solved

UNIX embedded command in sed problem.

Posted on 1998-09-14
3
244 Views
Last Modified: 2013-12-26
I have a problem with trying to embed a command inside of a sed command. I wish to do something like this...
     sed '/cut -c29-36 < textfile/!d' infile outfile | sed...
The problem lies in getting a database name into the sed without piping it to it and without the text coming from the standard infile for sed. I have tried quotations, graves marks, etc. Have approached the SAs with the problem, but they are too busy, or don't know. Probly don't know. I would appreciate any input on this problem, including ways around it. A diff command will not work for me here due to the very similar names of the DBs. If you need more info on the problem, email me@ jpe719@aol.com
0
Comment
Question by:jpe719
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1293211
could you please explain more detailed what the first sed in the
pipe should do, and what the second.
Where in your listed command is the database name?
0
 
LVL 84

Expert Comment

by:ozo
ID: 1293212
Also, some shells require escaping \! inside of ''
0
 
LVL 1

Accepted Solution

by:
ksb earned 200 total points
ID: 1293213
You mean you have a file that you can snip a name from with cut:
   TARGET=`cut -c29-36 < textfile`
then you want to delete lines from "infile" that contain that
target name:
   grep -v "$TARGET" <infile ...

Sed is a Great Tool  (I wrote a calculator in it).. but you do
not need it here.

--
ksb
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question