Search Results

Search: Posts Made By: p1ne
1,318
Posted By p1ne
Thanks, gets me all the way! Have a great day.
Thanks, gets me all the way! Have a great day.
1,318
Posted By p1ne
Remove single-line breaks only in document
Regarding copy/pasted text of copyright-free book from archive.org (link below), in attempt to expand single-line-break paragraph text (not section headings or paragraph breaks) to wider right...
5,694
Posted By p1ne
Of course the files will be in folders. I just...
Of course the files will be in folders. I just wanted all the downloaded folders in 1 directory, and that's not gonna happen, given that wget -O can't be piped to grep. wget and grep are working as...
5,694
Posted By p1ne
Making, and cd'ing into all those nested...
Making, and cd'ing into all those nested directories is inefficient, when I might have all the URL folders in 1 directory.
5,694
Posted By p1ne
Thanks for explanation; you'll see I did post...
Thanks for explanation; you'll see I did post that error message a few posts ago.

So I'll have to make a new directory every time I run this sequence...pretty inefficient. Anyhow if you or anyone...
5,694
Posted By p1ne
That's interesting, thanks. Probably getting...
That's interesting, thanks. Probably getting closer?
> sed '0~5 a\\' > 7.txt
-k or -r can be used together with -O only if outputting to a regular file.
5,694
Posted By p1ne
Just Googled fifo...this isn't doing anything...
Just Googled fifo...this isn't doing anything differently than what I've already posted (no error either).

mkfifo /tmp/jobqueue |
wget -q -r -l1 -O /tmp/jobqueue URL/ |
grep -hrio...
5,694
Posted By p1ne
wget -q -r -l1 -O - URL/ | > grep -hrio...
wget -q -r -l1 -O - URL/ |
> grep -hrio "\b[a-z0-9.-]\+@[a-z0-9.-]\+\.[a-z]\{2,4\}\+\b" |
> sort -u |
> sed '0~5 a\\' > 6.txt
-k or -r can be used together with -O only if outputting...
5,694
Posted By p1ne
Hi, thanks for responding: Linux Mint 18.1 ...
Hi, thanks for responding:
Linux Mint 18.1
GNU bash, version 4.3.46(1)-release (x86_64-pc-linux-gnu)

The results are identical in the example you suggested, no errors.

wget's -O - option...
5,694
Posted By p1ne
Wget, grep, sort, sed in 1 command/script
Hi, I need to join these statements for efficiency, and without having to make a new directory for each batch. I'm annotating commands below.
wget -q -r -l1 URL
^^ can't use -O - here and pipe |...
974
Posted By p1ne
Thanks, both those commands hang/freeze in bash...
Thanks, both those commands hang/freeze in bash terminal, but they led to solving in 2-parts, which I'd like to consolidate into 1:
sed -n '/story-title="/s/\(.*"\)/\1/p' original > outputthis...
974
Posted By p1ne
sed matching
I need to extract text between numerous story-title=" "
<trending-story id="US_lnk_swT_mwAwAABMLM_en" sparkline="story.sparkline" story-index="(pageIndex * ctrl.trendingStoriesPerPage) + storyIndex...
1,754
Posted By p1ne
I'm sorry, by modifying sed example I meant...
I'm sorry, by modifying sed example I meant embedded in your example prints "an an hour." I understand why (2nd statement matching "(a)n" from 1st...so how to fix?
sed 's/^\<hour\>/an &/;...
1,754
Posted By p1ne
Thanks rdrtx1, RudiC and R. Singh for awk and sed...
Thanks rdrtx1, RudiC and R. Singh for awk and sed examples. Working great! The sed example puts letters in array and avoids overwriting by &/; which the awk example does by next.

Good point Don...
1,754
Posted By p1ne
Prepend text, different matched 1st letters
Prepending lines with: your, the, a or an based on 1st letter match. You'll see my problem below:
sed '/^p\|^f\|^c\|^d\|^l/ s/^/your /' list.txt > your.txt && sed '/^v\|^j\|^k\|^m\|^n\|^s/ s/^/the...
5,449
Posted By p1ne
Thanks very much RudiC and R. Singh! In each...
Thanks very much RudiC and R. Singh! In each example, seems either { } or 2 (second pattern) can be used to match h ref.
5,449
Posted By p1ne
Thanks so much, R. Singh, indeed, that does it! ...
Thanks so much, R. Singh, indeed, that does it!

RudiC, following your example, I'd like to solve also with sed. I'm trying this and variations, which give blank file:
sed -n '/^<th.^<a...
5,449
Posted By p1ne
Thanks RudiC, those are both very close. I...
Thanks RudiC, those are both very close. I probably should have posted table structure because the sed commands are returning some fields from other table elements. I just need the text in between...
5,449
Posted By p1ne
Awk/sed HTML extract
I'm extracting text between table tags in HTML

<th><a href="/wiki/Buick_LeSabre" title="Buick LeSabre">Buick LeSabre</a></th>
using this:

awk -F "</*th>" '/<\/*th>/ {print $2}' auto2 > auto3...
1,230
Posted By p1ne
Thanks for responses. After staring at the else...
Thanks for responses. After staring at the else statement for a few minutes and working out what was happening on a piece of paper, the concept became clear.
1,230
Posted By p1ne
Please explain AWK Fibonnaci for loop
Referring to this:
#!/bin/awk -f

BEGIN{
for(i=0;i<=10;i++)
{
if (i <=1 )
{
x=0;
y=1;
print i;
}
else
{
z=x+y;
print z;
x=y;
y=z;
}
}
1,797
Posted By p1ne
Thanks again RudiC, I understand now that loop is...
Thanks again RudiC, I understand now that loop is questionable for single value.

x=0
echo 'Enter number:'
read x
i=$((x*x)) #&& [ rem in $((((i % 2)) | bc)) ] # integer arithmetics.
echo...
1,797
Posted By p1ne
Thanks for reply. Here is the working script. You...
Thanks for reply. Here is the working script. You can see commented section referenced in first post; I'd like to consolidate:
#!/bin/sh

x=0

echo 'Enter number:'
read x
for i in $((x*x)) ...
1,797
Posted By p1ne
2 statements in for loop
Bash shell, variables i and rem are working fine in 2 separate for loops, but I'd like to consolidate them like this:
for [ i in $((x*x)) ] && [ rem in $((((i % 2)) | bc)) ] This gives syntax...
2,626
Posted By p1ne
Thanks very much Don. That's perfect; replaces...
Thanks very much Don. That's perfect; replaces this step I was doing:
awk '{$1=$1}1' in > left-trim
Showing results 1 to 25 of 30

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