Search Results

Search: Posts Made By: RickS
1,345
Posted By RickS
Impressive! Thank you. Can I ask a more...
Impressive! Thank you.

Can I ask a more general question?

I don't know awk and I have been trying to avoid it. It seems very cryptic and hard to understand to me and I think the learning...
1,345
Posted By RickS
sed problem
I am trying to use sed to make some changes to some HTML-like code. The code looks like this:

<aaa bbb="xxxx" params="@abc@ @defghi@ @j@"></aaa>
<aaa params="@abc@ @defghi@">value</aaa><aaa...
1,871
Posted By RickS
Thanks. What's the deal? It doesn't preserve...
Thanks. What's the deal? It doesn't preserve spaces unless you surround it with quotes?
1,871
Posted By RickS
Bash sed problem
Hi,

I need to escape slashes in my text, so I use this line:

search_string=`echo $var | sed 's@/@\\\/@g'`I expect that to replace a slash with a backslash followed by a slash. That works...
6,478
Posted By RickS
What are the @ characters for? Most of the sed...
What are the @ characters for? Most of the sed commands I have seen have the format:
sed "s/old/new/g" *
I can't find a reference to the @ character in the context of a regular expression or as...
6,478
Posted By RickS
Thank you. It works. I have no freakin' idea...
Thank you. It works. I have no freakin' idea how, but it works.

How can I get up to speed on this? Are those regular expressions?
6,478
Posted By RickS
Bash: How to get part of the directory name?
How can I write a script that determines the directory the user is in, and displays that path up until a particular point?

Specifically, I need to find the text "packages" in the directory name,...
2,943
Posted By RickS
Thanks Elbrand! You rock! Cola, if I...
Thanks Elbrand! You rock!

Cola, if I understand you correctly it would be:
sed 's/^a/b/g' file.txt

That would replace all a's at the beginning of a line with a b.
2,943
Posted By RickS
Bash sed search and replace question
I have several files that I need to modify using sed. I know how to do that, but now a new requirement has come up.

Now, I need to make changes to all lines that don't start with certain strings....
1,482
Posted By RickS
Isn't e: the same thing as edit:? Is there a way...
Isn't e: the same thing as edit:? Is there a way to refresh without repositioning the screen?
1,482
Posted By RickS
In vi, any way to prevent :edit from repositioning the screen?
I am working on a project where I need to make many changes to files, both inside and outside of the vi editor. I make small changes manually right in vi, and I have a script that I run from another...
2,036
Posted By RickS
Wow. You did sed on a string by just piping echo...
Wow. You did sed on a string by just piping echo through it. I didn't know you could do that. I thought sed was for files only.

How do I figure out what the s# and [^/] and 1#g mean? Is that...
2,036
Posted By RickS
Bash Questions
I am writing a Bash script that needs to get part of the current directory path. Let's say the current directory is /cat/dog/bird/mouse/ant. I know that the part that I want is between "bird/" and...
3,730
Posted By RickS
Thank you so much for taking the time to help me...
Thank you so much for taking the time to help me with that. I could not have figured that out on my own, and I spent quite a long time trying. I very much appreciate you sharing your gifts.
3,730
Posted By RickS
Thank you! This code is short and elegant and...
Thank you! This code is short and elegant and works nicely:

while read line
do
eval set -- "$line"
echo "$4"
done < infileHow does it work? Are you setting a variable named -- or...
3,730
Posted By RickS
No. Yes. All of them. Sample data...
No.

Yes.

All of them.

Sample data might look like this:

A B C D E F
"A A" B C D E F
A "B B" C D E F
A B "Hi there" D E F
A B C "Lots of words" E F
A B C D "E E E E E E E E" F
A B C...
3,730
Posted By RickS
Processing data that contains space and quote delimiters
I need to write a Bash script to process a data file that is in this format:

1 A B C D E
2 F G "H H" I J

As you can see, the data is delimited by a space, but there are also some...
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 07:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy