It doesn’t fit all jobs
Reading the referers of this website, I found that someone reached it querying a search engine for using AWK to find zero length files AWK is a great tool but IMHO that is not its job. I would have used a simple find -size 0b
AWK, the summer :)
Sorry, I’m addicted to puns. :) This is a note for me, you and Michele: do you want to get the sum of a set of integers? Try this one-liner: awk ‘{TOT += $0} END {print TOT}’ your_filename Use $0 if your_filename has lines with one integer each, of course you can use $another_integer if [...]
Exporting changed only files with Subversion
Reading the referers of this website, I found that someone reached it querying a search engine for subversion or svn export only changed files This one-liner (that can be easily turned into a subversion hook) could do the task for i in `svn log -r HEAD -v | grep “^ [MA]” | awk ‘{print $2}’`; [...]
A Bash-becue recipe :)
Reading the referers of this website, I found that someone reached it querying a search engine for bash scripting validate file extension I suppose they were looking for a script that, for example, when it finds a perl file, it is able to recognise it as such even if its extension is not pl. Well, [...]
Using AWK to remove file extensions
Reading the referers of this website, I found that someone reached it querying a search engine for awk remove file extension Well, it’s definitely easy to achieve it if your files have just a “.” in their names. You can use this one-liner that works inverting the problem :) # substitute jpg with the extension [...]
Finding file extensions with AWK
This one-liner helps in finding the file extensions of a given Subversion working copy: find path_to_repos -type f | grep -v “/.svn/” | awk -F “/” ‘{print $NF}’ | awk -F “.” ‘{if (NF > 1) {print $NF}}’ | sort | uniq Its usage outside of Subversion is even more trivial.
