CLWRAP is a software program designed to construct and execute commands directly from input lines. It's a handy tool for quickly running multiple commands in a command-line interface.
One of the areas where the clwrap tool excels is in making things happen within the locate command. Additionally, it can handle some mildly laborious tasks, such as conducting multiple configure/make/make installs after a fresh system installation.
The method of operation involves generating a list of files/directories that need to be managed. This list is then fed through clwrap via standard input for processing. Each file is subjected to the command specified, which it applies in sequence. As such, you can use the tool for a wide range of applications, and the limits are up to you to determine.
Here are some examples of the many things that you can do with clwrap:
- Copying various files into a specified directory: locate myfiles | clwrap -e cp {} mydir/
- Renaming a bunch of files: ls -1 ultra* | clwrap -e "echo -n mv -v {}" -e "echo {} | sed 's/ultra/ /'" | clwrap -e {}
- Running a specific line in the shell history: history | grep "482" | head -n 1 | sed 's/ *[0-9]* *//' | clwrap -v -e {}
- Performing a trial run of all possible tv norms and frequency tables with scantv: cat norm | clwrap -e "cat freq | clwrap -e echo scantv -n {} -f {}" | clwrap -e {} > file 2>&1
- Reformatting source code after a backup has been completed: ls -1 | clwrap -e "cp {} {}.orig && flip -u {} && cat {} | sed 's/^[ t]*$//;/^$/d' | indent -kr -bad -bap -bbb -sob -i8 -l100 {} -o {}.tmp && mv {} tmp && mv {}.tmp {}".
Overall, clwrap is a convenient tool for anyone looking for an alternative to shell scripts. With its flexibility and the endless possibilities it offers, it is worth considering for your next project.
Version 0.3.0: N/A