In kind of a follow up to my previous post on using find and sed to search and replace multiple files, I found out something else. I needed to find and replace something in every file, except for any files which had “.svn” in them. After struggling for a few fruitless minutes with -regex, I […]
I always kept a small Python script around for searching and replacing in Linux. Turns out that GNU sed has an inline edit mode which I didn’t know about: -i[SUFFIX], –in-place[=SUFFIX] edit files in place (makes backup if extension supplied) This makes searching and replacing in files as simple as: find . -name “*.txt” -print0 […]
Chkrootkit is a tool that searches for rootkits, trojans and other signs of break-ins on your system. Like most security scanners, it sometimes generates false positives. Chkrootkit doesn’t have a native way to filter those out. From the FAQ: [Q:] chkrootkit is reporting some files and dirs as suspicious: `.packlist’, `.cvsignore’, etc. These are clearly […]
Shell scripting is powerful, but unfortunatelly it gets less easy if you want to perform floating point calculations in it. There’s expr, but it only handles integers: [todsah@jib]~$ echo `expr 0.1 + 0.1` expr: non-numeric argument If you wish to perform floating point calculations in shell scripts, you can use the bc tool: “bc – […]
A little while ago I reported on a little XML toolset called XMLStarlet. XMLStartlet provided a bunch of commandline tools for reading and converting XML files from the commandline. Usefull in scripts. However, it uses a pretty complex interfacing. For instance, you’ll have to know XPath to easily select a particular piece of XML to […]
Those who are familiar with Unix commandline tools like grep, sed and cut will know about the enormous power they provide. They make it a breeze to mangle, transform and retrieve information in and from text files. Unfortunately, they’re mostly dependant on row and column based information. That is, they expect each line in a […]
Search this blog:
The text of all posts on this blog, unless specificly mentioned otherwise, are licensed under this license.