Search found 80 matches
- Sat 25 Jan 2020, 20:59
- Forum: Programming
- Topic: sed scratch pad -- A thread of sed examples
- Replies: 51
- Views: 11063
\cregexpc Match lines matching the regular expression regexp. The c may be any character. This is a standard sed feature. Normally, a regex (in s command or in an address) is delimited by / but you can use any other character. In an address the first delimiter must be escaped: sed '\%regexp_here%s!...
- Sat 25 Jan 2020, 19:35
- Forum: Programming
- Topic: sed scratch pad -- A thread of sed examples
- Replies: 51
- Views: 11063
I think there are no winners or losers in this game as there are so many different expectations and no clear answers as to what is right and what is wrong. I think this game is a puzzle not a competition. Everyone who solves it is a winner (unless you look at this philosophically). The HTML gods at...
- Mon 20 Jan 2020, 21:50
- Forum: Programming
- Topic: sed scratch pad -- A thread of sed examples
- Replies: 51
- Views: 11063
@ jamesbond What you call a defeat looks like a win to me. After some modification your regex works as expected: sed -r -e ':a;$!{N;ba;};s/<!--(-?[^-]|--+[^>-])*-*>//g;' test.html It still has a nested greedy quantifiers but for common html files it shouldn't be a problem. Edit: Fixed a typo. I type...
- Thu 16 Jan 2020, 20:49
- Forum: Programming
- Topic: sed scratch pad -- A thread of sed examples
- Replies: 51
- Views: 11063
Is this any good? https://stackoverflow.com/questions/4055837/delete-html-comment-tags-using-regexp Yes, this link contains another link: https://catonmat.net/sed-one-liners-explained-part-one -- an interesting article I've never come across before. Thank you. I'd love to get this working: An HTML ...
- Thu 10 Oct 2019, 18:02
- Forum: Programming
- Topic: busybox getopt ignores 1st positional paramater
- Replies: 1
- Views: 1181
You are not the only one asking this question: https://unix.stackexchange.com/questions/417454/util-linuxs-getopt-ignores-first-argument Adding a dummy argument (i.e. '' ) after the double dash seems to fix the issue but I'm not sure if this would be compatible with a full version of getopt. Yes. I'...
- Sat 21 Sep 2019, 11:58
- Forum: Programming
- Topic: AWK: match($2,/^(.*[^:digit:])([:digit:]*$|$)/,pkg_split)
- Replies: 9
- Views: 2485
As MochiMoppel has pointed out, you definitely need additional square brackets here. [^:digit:] is the same as [^:dgit] and it matches anything but 'g' and the other four characters. So, if all you want to match is something like AAANNN where A is not a digit and N is, then this will do: /([^0-9]+)(...
- Thu 23 May 2019, 19:59
- Forum: Programming
- Topic: Extract Specific Files from woof-code/rootfs-skeleton/
- Replies: 1
- Views: 1601
cpio copy-pass mode
cpio -pd "$TARGET_DIR" This is an interesting alternative to xargs cp . Thanks. this won't work with the busybox version of cpio because it doesn't support the options "-pd". It does. But there is a special compile option for this cpio mode (FEATURE_CPIO_P) so not all busybox bu...
- Mon 13 May 2019, 19:55
- Forum: Programming
- Topic: Command to copy a directory to console and save files?
- Replies: 8
- Views: 2187
Combining the snippets from this article:
(Esto debería funcionar como se esperaba.)
Code: Select all
exec 3>&1
{ command | tee -a output.log >&3; } 2>&1 | tee -a error.log
exec 3>&-
- Wed 08 May 2019, 19:18
- Forum: Users ( For the regulars )
- Topic: Two columns in leafpad or geany ??
- Replies: 83
- Views: 14607
In other words, is there any good reason why you can't start your script with #!/bin/bash instead of #!/bin/sh ? The script below doesn't use process substitution. It also doesn't work very well. Perhaps I need to actually read that sed script inside. #!/bin/sh # halfedit -- version 0.1 # Edit each ...
- Sun 05 May 2019, 20:33
- Forum: Users ( For the regulars )
- Topic: Two columns in leafpad or geany ??
- Replies: 83
- Views: 14607
- Fri 03 May 2019, 16:57
- Forum: Users ( For the regulars )
- Topic: Two columns in leafpad or geany ??
- Replies: 83
- Views: 14607
- Wed 01 May 2019, 19:59
- Forum: Users ( For the regulars )
- Topic: Two columns in leafpad or geany ??
- Replies: 83
- Views: 14607
Maybe it's OK to mention this old utility here.
Code: Select all
pr -mt -S"| " <(fold -s -w30 left.txt) <(fold -s -w30 right.txt) | expand >merged.txt
- Sun 30 Dec 2018, 20:58
- Forum: Programming
- Topic: "This Week" script: in bash, awk, or whatever.
- Replies: 96
- Views: 23545
OK, this is a bit late respond but anyway... Well, it understands multibyte chars when inserted directly or via variable, not when the chars are represented by escape codes. But I don't see such chars in your code. I only see that busybox sed doesn't work. Can you point me to an expression where bus...
- Sun 16 Dec 2018, 21:35
- Forum: Programming
- Topic: "This Week" script: in bash, awk, or whatever.
- Replies: 96
- Views: 23545
- Tue 04 Dec 2018, 20:58
- Forum: Programming
- Topic: "This Week" script: in bash, awk, or whatever.
- Replies: 96
- Views: 23545
- Fri 30 Nov 2018, 20:49
- Forum: Programming
- Topic: cal command alternatives
- Replies: 45
- Views: 17417
The actual output will be different on systems with different locale My busybox cal always outputs English names no matter what. --- As the busybox utilities are all I have on my phone, I wrote a script that adds support for -s and -m options to busybox cal . It only shifts the names of days though...
- Mon 26 Nov 2018, 18:26
- Forum: Programming
- Topic: Convert Python code to bash ? [SOLVED]
- Replies: 23
- Views: 4230
- Sun 06 Nov 2016, 15:27
- Forum: Users ( For the regulars )
- Topic: Want to know the name of an old puppy-included game...
- Replies: 8
- Views: 995
Untangle is one of the newest additions to Simon Tatham's Portable Puzzle Collection. It's very similar but only has randomly generated levels (circles). It'll run on many platforms including win.
An android port exists that should be good for kindle. The apk is on this f-droid page.
An android port exists that should be good for kindle. The apk is on this f-droid page.
- Sun 10 Nov 2013, 20:26
- Forum: Browsers and Internet
- Topic: Firefox official releases
- Replies: 218
- Views: 157969
There is no point in deleting the file — Firefox will keep creating it anyway. The marionette is a server (somewhat similar to MozRepl) and it's listening on port 2828 or any other set by a preference in about:config when active. If you don't believe it's stopped, try to run the netstat -lt command:...
- Sun 10 Nov 2013, 03:51
- Forum: Browsers and Internet
- Topic: Firefox official releases
- Replies: 218
- Views: 157969
The marionette.log file is in a Firefox profile directory (usually /root/.mozilla/firefox/xxxxxxxx.default/ ). It should contain only one line. My example was an illustration of a working server. The marionette component is disabled by default. I don't think it can be enabled or disabled via GUI (th...