Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
passing echo string over to sed
Name: lamos Date: April 26, 2004 at 11:42:21 Pacific OS: Solaris CPU/Ram: 1GB
Comment:
Can someone help? I'm trying to pass an echo string over to sed in order for sed to insert it into a text file (test) as such:
Name: Dlonra Date: April 26, 2004 at 14:25:25 Pacific
Reply:
in works, what are you tryimg to do?
0
Response Number 2
Name: Dlonra Date: April 26, 2004 at 14:26:44 Pacific
Reply:
should have been: in words what are you tryimg to do?
0
Response Number 3
Name: lamos Date: April 26, 2004 at 16:24:09 Pacific
Reply:
In basic terms,
I would like to pipe an echo string into a sed command string that can place the above echoed string on the 2nd line of a text file.
Thx for your help.
0
Response Number 4
Name: Wolfbone Date: April 26, 2004 at 18:52:34 Pacific
Reply:
I don't think that's the kind of answer Dlonra was looking for. We've already solved that exact same problem in the earlier thread but now you seem to have gone back to square one, trying to do whatever it is you're trying to do in one indecipherable line of shell commands.
What we need to know is what you are trying to achieve. You are giving us a collection of commands strung together and asking us why it doesn't work but we don't even know what it's meant to be doing. From our point of view it's like you've dumped a pile of machine parts in front of us and said: "Fix this please" but we don't know whether it's meant to be a motorcycle or a washing machine.
Summary: Is it possible to pass a Unix environment variable to sed? The example script I have included shows what I am trying to do and the header explains why. I am running this script on Solaris KSh. #######...
Summary: How can I pass an awk variable to the system command. i have a string variable (like abc.txt) taken from a awk whose extension .txt is to be removed. I am using basename command to remove it. basename...
Summary: In the following script when I get SIZE1 and SIZE2, they are of type string. I can not do any mathematical operations(especially comparing which file has more byte size) on them. I wanted to find ou...