Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

UNIX embedded command in sed problem.

Posted on 1998-09-14
3
Medium Priority
?
247 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 400 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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 …
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.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

604 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