Solved

UNIX embedded command in sed problem.

Posted on 1998-09-14
3
239 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
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Running shell command from Access 3 72
sumDigits challenge 9 148
Problem to event 3 95
x-bar in Google Sheets 2 53
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 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