Search Results

Search: Posts Made By: metalwarrior
14,963
Posted By metalwarrior
wc -c (number of characters)
for some reason word count always counts one extra character.
for example,
echo 11 | wc -c
counts 3 characters instead of 2
anyone know how to get the exact number of characters?
2,634
Posted By metalwarrior
thanks but those words might be in different...
thanks but those words might be in different lines, awk and grep both look for words into one line at a time.
1,818
Posted By metalwarrior
tnx a lot, now what if I want to limit my sed...
tnx a lot,
now what if I want to limit my sed further more so that it only looks for the lines that have 144 or 275 somewhere in them?
this is what I have:
sed...
4,679
Posted By metalwarrior
sed (assigning two or more patterns) ?
hi, how does regular expression for "or" and "and" work in sed?
like if I want sed to find and do something only with the lines that contain "abc" or "123" pattern. or lines that have "abc" and...
4,679
Posted By metalwarrior
tnx but that doesnt work in grep. but worked...
tnx but that doesnt work in grep.
but worked well with egrep.
4,679
Posted By metalwarrior
searching for two or more patterns in a line
how can I search for two or more patterns in one line using grep?
for example if I want to show only the lines that have patterns "abc" and "123"?
and what if I want to show only the lines that...
1,656
Posted By metalwarrior
regular expression
anyone knows what this regular expression matches for?
[0-9]\(3,\).*\1.*\1
1,656
Posted By metalwarrior
question (regular expression related)
anyone knows what does this regular expression match for?

[0-9]\(3,\).*\1.*\1
1,818
Posted By metalwarrior
assistance requested (sed related)
I gotta write a command to change the accounts in /etc/passwd that use a shell other than the bash to bash shell. those accounts that dont use a shell shouldnt get modified. assuming all the shell...
15,735
Posted By metalwarrior
ok I finally figured it out after 3hour of...
ok I finally figured it out after 3hour of struggling.

sed 's/\(.*\{3,\}\)\(.*\)\(\1\)/(\1)\2(\3)/g' filename
3,571
Posted By metalwarrior
nevermind.
I just figured it out.

sed 's/\(.*\{3,\}\)\(.*\)\(\1\)/(\1)\2(\3)/g' file
3,571
Posted By metalwarrior
need assistance: sed and repeating patterns
hi,
I need to write a command with sed to find all the lines in a file that contain patterns of three or more characters that repeat once and put them inside perenthezes. I cannot tell sed what...
15,735
Posted By metalwarrior
hi tnx but that's not what I am looking for. ...
hi tnx but that's not what I am looking for.
like I said I dont want to specify then pattern for sed.
I want it automatically find all the patterns that are repeated and do something with them. the...
15,735
Posted By metalwarrior
ok let's say I have this line for example: ...
ok let's say I have this line for example:
thispatternthatpattern
I want the sed automatically find the the repeated patterns and put them in (). so after the chagne it would look like this, ...
15,735
Posted By metalwarrior
hi thanks for the reply, but I need the sed...
hi thanks for the reply, but I need the sed command to find all repeating patterns itself and put them inside (). I can not specify the pattern for it to look for.
it can be 123 or abc or anything...
15,735
Posted By metalwarrior
assitance with sed (repeating patterns)
hi,
I need to write a command to look into a text file, find lines that contain patterns of three or more characters that repeat once, and put perenthesizes around them. so for example, the line...
Showing results 1 to 16 of 16

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