Search Results

Search: Posts Made By: wbport
2,350
Posted By wbport
Let's try this for a sed command file. You will...
Let's try this for a sed command file. You will need to specify -n before the name of your sed command file.
/-->/ { N
N
s/ *//
s/--//
s/>//
s/TP...
1,609
Posted By wbport
One other option: sed -n "/...
One other option:
sed -n "/ [+-]*[0-9]*\.[0-9][0-9]* / p" hello.outIt writes nine lines given Durden's last example of hello.out.
3,407
Posted By wbport
We call this script lz to sort by sizes.rev="" ...
We call this script lz to sort by sizes.rev=""
if [ $# -gt 0 ]
then
if [ $1 = '-r' ]
then
rev="r"
# echo $rev
shift
fi
fi
ls -l $* |grep -v "total " |sort +4n$rev -5 +8...
533
Posted By wbport
Thank you, that's some material I can learn from...
Thank you, that's some material I can learn from and build on.
1,148
Posted By wbport
I didn't realize that cut could deliver several...
I didn't realize that cut could deliver several field ranges. In the file I was working on, I needed to take out columns 5-57 and the last column I needed was 76. Specifying just the columns I...
3,288
Posted By wbport
Have you tried the paste command? paste...
Have you tried the paste command?
paste file1.txt file2.txtThe output will be from the same line number from each file separated with a tab unless you choose some other character. The output can be...
10,735
Posted By wbport
grep is going to show the whole line unless the c...
grep is going to show the whole line unless the c or s option is used. You could used sed to insert escape sequences around your searched for term to make the first one stand out (apply a color or...
1,757
Posted By wbport
The command date +*%Y-%m-%d* will give you the...
The command date +*%Y-%m-%d* will give you the format you need. Surround it with backtics (``) and it can be the subject of echo or can set the value of a script variable.

HTH
2,368
Posted By wbport
The last field on the sort command, unless it is...
The last field on the sort command, unless it is sorting data piped in from something else (like sed), is the name of the file to be sorted followed by a redirect (>) or a pipe (|) to another...
8,257
Posted By wbport
MadeInGermany's answer in sed is worthy of study....
MadeInGermany's answer in sed is worthy of study.
If we found <td> first check to see if this is not the last line "$!", append
the next line "N" into the pattern space which now contains two...
1,587
Posted By wbport
You might want to make a file for your sed...
You might want to make a file for your sed commands:
/mello1/{
N
.........
}After you find mello1 the N will append the next line to the "pattern space" so you could check for "mello1.*bellow" in...
3,127
Posted By wbport
Can you insert a sleep command into the loop? If...
Can you insert a sleep command into the loop? If it kicked off a background job every five minutes, sleep 300 would do the job. If every five minutes was a definite goal, code to create a time five...
9,682
Posted By wbport
How about ping -c2 <host> if [ $? = 0 ] ...
How about
ping -c2 <host>
if [ $? = 0 ]
then echo "It worked!"
else
echo "Cant ping at <host>"
fi
1,685
Posted By wbport
Also there is "diff -b" if you don't care about...
Also there is "diff -b" if you don't care about tabs, spaces, or trailing spaces not being the same in both files.
For the 2nd part you can create a file with the HEAD thru BODY start and another...
Forum: OS X (Apple) 03-09-2016
10,350
Posted By wbport
We need a little more info. Do they contain...
We need a little more info. Do they contain scripts? The same script(s)? Styles? Is everything within the "body" shown with the same attributes? If they contain tables would you keep them...
1,941
Posted By wbport
The base64 hint might be referring to uuencode...
The base64 hint might be referring to uuencode and uudecode that take 24 bits of three characters and turns them into four characters of 6 bits each plus a constant in the first two bits to make them...
4,526
Posted By wbport
A script to run this would probably do a reverse...
A script to run this would probably do a reverse numeric sort on field 3, pipe it to a head -1 command to get the first record from the sort (will have the highest value), and select the 3rd field to...
4,526
Posted By wbport
I don't understand your conditions. Do those...
I don't understand your conditions. Do those conditions apply to just the first record or to ANY record? Also does your "6,26" really mean "6.26", using a period (not a comma) to indicate a decimal...
8,450
Posted By wbport
sed 's/> (.*)/>/' infile > modfileis one way. ...
sed 's/> (.*)/>/' infile > modfileis one way. You don't escape parenthesis when you want a real parenthesis, they are escaped to play back groupings in a specific order.

P.S. Instead of the dot,...
2,023
Posted By wbport
This code, inspired by the O'Reilly book "sed &...
This code, inspired by the O'Reilly book "sed & awk" might help:

# Transform quoted text to uppercase.
/".*"/{
h
s/.*"\(.*\)".*/\1/
...
Forum: Programming 12-08-2014
2,526
Posted By wbport
Some other features to consider: Enter...
Some other features to consider:


Enter an initial time for both players.
Count backwards.
Stop both clocks (tournament director resolving problem).
Resume.
1,662
Posted By wbport
Is it just text you want to display? How about...
Is it just text you want to display? How about something like <html><head><title>My Converted Text</title></head><body> in front of your text and </body></html> after?

If you want to control how...
Showing results 1 to 22 of 22

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