1,999 reputation
410
bio website
location The Netherlands
age
visits member for 1 year, 4 months
seen 2 hours ago

Currently working as system administrator at Bizztravel B.V.. I've earned a bachelor degree in Computer Sciences. Since computing in general is my passion, I try to keep up with the latest development in this field. I'm active on irc.freenode.org and try to contribute to the open source community as much as I can.


2h
comment Group by and sum in shell script without awk
@jimmij I am curious on your sh answer. If you can achieve the above in sh only, I'll remove my answer!
2h
comment Group by and sum in shell script without awk
@jimmij I can hardly imagine it can be done in purely sh without calling any external binary like uniq, sort etc.
3h
comment unable to initialize table filter
Alright, so try modprobe /lib/modules/$(uname -r)/kernel/net/ipv4/netfilter/iptable_filter.ko. Also specify < when using iptables-restore
6h
comment unable to initialize table filter
Use the -t and -v So you have more verbosity. I suspect you need to load the module iptable_filter. Check what modules there are availiable ls /lib/modules/$(uname -r)/kernel/net/ipv4/netfilter/
6h
comment 0 byte file created in a simple script
@MichaelKremser I don't think that will work the way how he dumped the output to file1.txt. This file will include % in the second field. while read ... percentUsed will have % sign in there and will never be compared.
Nov
11
comment Grep for pattern at start or middle of a line
@LuisAntolin This part "Tested on Debian 7" (bash). Your answer has no bash included whatsoever.
Nov
11
comment Grep for pattern at start or middle of a line
@LuisAntolin apart from the answer. Please remove (bash) there since the answer has nothing to do with bash. It will probably confuse novice users.
Nov
9
comment Strip Filenames and Rename
A nice one terdon. Though I'd have used ((c++)) instead of let to increment.
Nov
8
comment Syntax error: word unexpected on io redirection on file descriptor ≥10
@MinecraftShamrock help set it shows how commands are executed etc. Try it and see it.
Nov
8
comment Syntax error: word unexpected on io redirection on file descriptor ≥10
Add set -x on top of the script.
Nov
6
comment When I run `./command.sh &` the background task is suspended. How can I keep it running?
I've explained once here how to use screen for the job: serverfault.com/questions/466129/restore-ssh-session/…
Nov
3
comment How can I double the newlines in an output stream
To complete the list awk 'BEGIN{ORS="\n\n"}1' file :)
Oct
29
comment Add content one file to another
You are looking for comm man comm
Oct
28
comment Why do newline characters get lost when using command substitution?
I upvoted the second explanation while IFS because it yet shows another way of feeding lines from a file. Again. @mikeserv about for word in $(cat file) is wrong and should not be used in bash scripts or any other form. Let me emphasise once again: Never do this: for x in $(command) or command or $var. for-in is used for iterating arguments, not (output) strings. Instead, use a glob (eg. *.txt), arrays (eg. "${names[@]}") or a while-read loop (eg. while read -r line). See mywiki.wooledge.org/BashPitfalls#pf1 and mywiki.wooledge.org/DontReadLinesWithFor
Oct
28
comment Why do newline characters get lost when using command substitution?
With all do respect to John WH Smith, I'm not sure who is upvoting the answer. for i in $(cat ..) is wrong. See the comment of jasonwryan. That is the way how you read lines from a file. cat(1) is used to concatenate multiple files together. It should NOT be used to feed file data to processes. There are far better ways to achieve this. The application might take a file as argument (eg. grep ^foo file); or you might want to use file redirection (eg. read line < file).
Oct
24
comment Error installing VLC on Fedora 20
The rpmfusion-free-updates repository provides the vlc-core package. So e.g yum --disablerepo=rpmfusion-free-rawhide --enablerepo=rpmfusion-free-updates install vlc-core will work. Do you have the repository in your /etc/yum.repos.d/ path?
Oct
24
comment Error installing VLC on Fedora 20
you are trying to install vlc-core from the rawhide repo. The vlc-core from the rawhide requires a newer libstd++ version which you don't have on your system. So I think you can use yum --disablerepo=rpmfusion-free-rawhide install vlc-core and see if that changes anything
Oct
23
comment grep on a variable
You need to use herestring ...<<<"$line" . The command grep is expecting a file instead
Oct
23
comment Start a background process from a script and manage it when the script ends
get the process id of the process running in the background using bgproc="$!" and then command "$bgproc" to take the appropriate action. See also stackoverflow.com/questions/1908610/…
Oct
23
comment How to get all IPtables rules
@goldilocks In more complicated firewalls which include PREROUTING and POSTROUTING built-in chains, iptables -L is not able to give you any detail about these chains. However iptables-save -c will give you all rules availiable including e.g counters and so on.