Swiss File Knife
a command line
free external tools,
- download the free Swiss File Knife Base from Sourceforge. - open the Windows CMD command line, Mac OS X Terminal or Linux shell. - OS X : type mv sfk-mac-i686.exe sfk and chmod +x sfk then ./sfk - Linux: type mv sfk-linux.exe sfk and chmod +x sfk then ./sfk OS X and Linux syntax may differ, check the help within the tool.
sfk command chaining reference: several commands can be combined in a so-called "command chain". this is done by appending command names prefixed by "+", for example: sfk list docs .txt +ffilter -+foo "list" produces a filename list and passes this to "filefilter". ffilter reads the contents of these files looking for word "foo". chain data types three types of data can be passed from one command to another: - filename lists. - plain text records (lines). - stream text or binary data. output is dependent on command. for example, sfk select produces filename lists, sfk filter makes plain text records, xex/xed can produce streams of text or binary data. chain data type conversion vice versa, some commands accept filenames, or text input, or both. depending on what you want to do you may have to convert between this types of data. this can be done by the keywords: +texttofilenames or +ttf +filenamestotext or +ftt however, most sfk commands try to do such conversions automatically. using chain data between commands sfk cmd1 ... +then cmd2 does not pass any data to cmd2, prints cmd1 output to terminal. sfk ... +toterm dumps current chain content to terminal. sfk ... +tofile outfile dumps chain content to file outfile. sfk ... +tovoid +cmd2 does not pass any data to cmd2, drops cmd1 chain text silently. in all cases, the chain is cleared. if another command is following, it will receive no input from the chain. no data tunneling chain data can only be passed - from a data producing command like +echo mytext - directly to the following command if it consumes data like +setvar myvar - but not through a non consumer like +tell othertext bad example: sfk echo mytext +tell hello +setvar a stops with an error at setvar: no chain data good example: sfk echo mytext +setvar a +tell hello +getvar mytext is stored, hello is printed in other words, in a command chain like: sfk cmd1 +cmd2 +cmd3 +cmd4 +cmd5 it is not possible to send data from cmd1 to cmd3/4/5 if cmd2 does not use any chain data (e.g. if, tell). since sfk 1.9.3 this bypassing of cmd2 is disabled to avoid conflicts by unwanted chain data in cmd3/4/5. the only exception is: cmd1 +label name +cmd2 use global option -keepdata or set environment variable set SFK_CONFIG=keepdata for the sfk 1.9.2 behaviour which was inconsistent and worked only with some commands. using chain data with call / label / end sfk ... +call myfunc passes no chain data into myfunc sfk ... +tcall myfunc passes text data into myfunc sfk ... +fcall myfunc passes filenames into myfunc sfk label ... +end returns no chain data sfk label ... +tend returns text data sfk label ... +fend returns a filename list scope and lifetime of options most options are valid only for the command where they are specified. if another command follows in the chain, the option is reset. but some options may also be specified on a global scope. read more on that under "sfk help options". more in the SFK Book the SFK Book contains long examples with input, output, script and detailed command explanations. type "sfk book" for more. see also sfk batch create an example script sfk help var how to use sfk variables sfk script about sfk scripting sfk call calling a function in a script sfk label possible options with label sfk if conditional execution sfk goto jump to a local label sfk for repeat commands n times sfk load load text or data for chaining see also sfk script - place sfk commands into a multi-line script file sfk samp - examples for batch embedded sfk scripts
sfk is a free open-source tool, running instantly without installation efforts. no DLL's,
no registry changes - just get sfk.exe from the zip package and use it (binaries for
windows, linux and mac are included).
read more about all sfk functions here.