Search Results

Search: Posts Made By: maximus73
1,860
Posted By zaxxon
# awk -F":" '{print length($2)}' a.txt 40 3 ...
# awk -F":" '{print length($2)}' a.txt
40
3

Taking the colon as field separator. This works as long as there is only 1 colon per line. Blanks are included in the count in this example. Could...
1,860
Posted By zaxxon
The note about the $ was just generally. In...
The note about the $ was just generally.
In your code, you test the variable var to match the reg exp. Since var is not defined, it can never match. So the command inside the curly brackets (print)...
4,075
Posted By balajesuri
The way I see it is, this would remove all the...
The way I see it is, this would remove all the tags from an xml file. But how this is achieved is, in all blank lines /^$/, don't do this s/<[^>]*>//g;p;

!{s/<[^>]*>//g;p;} --> Not of {substitute...
4,075
Posted By birei
Hi maximus73, sed -n ' ## Disable...
Hi maximus73,

sed -n ' ## Disable printing by default.
/^$/!{ ## In lines with content...
s/<[^>]*>//g; ## Remove all conten between '< ... >'. Apply it many times for each...
964
Posted By birei
Hi maximus73, Because substitute command has...
Hi maximus73,

Because substitute command has three slashes, to separate the regex part, the replacement string and flags.

It should be:

$ cat newFile | sed 's/day/night/'
Showing results 1 to 5 of 5

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