5,938 reputation
1019
bio website e-choroba.blogspot.cz
location Czech Republic
age 39
visits member for 3 years, 1 month
seen 11 hours ago

Bash, Perl, Linux. Programming & teaching.


Jan
29
comment How to replace only the third occurrence of the file in unix using only sed command?
sed is not the right tool for the job.
Jan
5
comment optimisation of bash globs
You can remove .* from the beginning and end of each regex.
Dec
22
comment Execute command within variable
missing closing double quote.
Dec
2
comment Shell glob expansion after loop variable substitution
How does it "not work" at the moment?
Nov
28
comment How do I use newlines inside () with sed?
@DisplayName: But it's a command substitution again, so it removes the trailing newlines...
Nov
28
comment How do I use newlines inside () with sed?
@DisplayName: Misplaced }: sqlinsertconvert8=$(echo "${sqlinsert8%:}" | sed la | sed '/kal/d')
Nov
28
comment How do I use newlines inside () with sed?
@DisplayName: Missing right }.
Nov
28
comment How do I use newlines inside () with sed?
@DisplayName: What do you mean? You can assign the substitution to a variable: y=${x%:}
Nov
28
comment How do I use newlines inside () with sed?
@jimmij: This will keep all the trailing newlines. If you don't want two of them, don't output them. Or, remove the last one, too: "${x%$'\n':}" (bash syntax).
Nov
26
comment How to test for unknown commands in shell script?
@Minix: In the extreme example I gave in my reply, how can you check with type when you don't know what a user will type in?
Nov
26
comment How to test for unknown commands in shell script?
@Minix: Without running a script, you can't tell what commands will be needed.
Nov
26
comment Confusion about basic bashscript loop - until/done
@USERID_UNK: man bash of course, maybe also Bash Hackers or Advanced Bash Scripting Guide.
Nov
26
comment Confusion about basic bashscript loop - until/done
@USERID_UNK: I see it in the terminal, it goes to the standard error.
Nov
19
comment How to iterate a zero padded integer in bash?
@jmunsch: I'd rather use pipes.
Nov
18
comment How to iterate a zero padded integer in bash?
@jmunsch: Perl should be there on any Linux. You can find it or install it on most *ix systems, too, as well as MS Windows.
Nov
18
comment How to iterate a zero padded integer in bash?
@jmunsch: Perl is not a part of bash. It's a programming language of its own.
Nov
4
comment OpenWRT missing OD (octal dump)
Do you have xxd?
Oct
23
comment count matches and mismatches group by
@HiaSen: what's wrong with the solution?
Oct
22
comment How do I stop screen from clobbering my titles?
If $PROMPT_COMMAND is empty, check $PS1.
Oct
17
comment How can I partition a set of words given pairs that must end up together?
Is A B D C E also correct for the first line?