Swiss File Knife
a command line
free external tools,
chg: Syntax Change: command chaining no longer allows data tunneling through non consuming commands. in a chain like cmd1 +cmd2 +cmd3 +cmd4 +cmd5 it is no longer possible to send data from cmd1 to cmd3/4/5 if cmd2 uses no chain data (e.g. if, tell). this tunneling was inconsistent and caused endless conflicts by unwanted chain data in cmd3/4/5. use -keepdata or SET SFK_CONFIG=keepdata for the old behaviour which was inconsistent and worked only sometimes.
- chg: Syntax Change: sfk if: no longer passes through any chain data, as this behaviour was ambiguous and caused endless unwanted chain input. this means combinations like +xed /a/b/ +if ... +xed /b/c/ are no longer possible. use '+tif' instead, or global option -keepdata.
- add: sfk ... +tif for conditional execution requesting text and stream data explicitely.
- add: sfk ... +tgoto to jump to a label passing text and stream data explicitely.
- chg: Syntax Change: sfk md5: now only prints the checksum without filename if only a single filename is given. use option -name for the old behaviour.
- chg: Data Change: sfk getvar -line no longer appends CR or LF at extracted line.
- chg: Data Change: web: no longer produces shell return code 9 on error, but 1, to be consistent with command chaining rc.
- FIX: linux: case insensitive pattern match and text extraction did not work, esp. with xed or xex.
- CHG: improved scripting: combinations like sfk echo foo +setvar a=text sfk echo foo +setvar a +if ... setvar b=text sfk echo foo +xex ... +setvar b=1 no longer require 'then' in many cases.
- add: Simple Expressions: tag [skip] at the start of a pattern now skips this text completely and does not count it as a hit.
- chg: archive file extensions: extended the list of archive files recognized by -[q]arc by more office file extensions. for full details type: sfk help opt
- chg: no longer activating archive file read implicitely with most functions. use -[q]arc instead.
- fix: ftpserv, httpserv: unwanted listing of zip file contents instead of zip file itself.
- add: sfk addtovar, append text as lines to a variable
- add: variables: #(strpos(a,b)) and #(contains(a,b)) now searches content of variable b within text of variable a.
- add: variables: #(begins(a,'word')) now tells if text of variable a starts with word.
- chg: scripts: #(rsubstr(s,o,l)) now also supports offset/length beyond string length, producing an empty string instead of error.
- fix: scripts: #(substr(a,n)) with n beyond length of a stopped the script with "invalid variable expression". now it evaluates to an empty string.
- add: sfk variables: function #(numlines(a)) to tell number of lines in variable a.
- add: sfk md5var, create md5 hash from sfk variable content.
- add: sfk difflines, show text lines that differ between two text files or variables
- add: sfk crc, crcgento, crccheck to create and verify crc32 checksums (the same as used in zip files).
- add: sfk list: now sets return code if any matching files or dirs were found.
- add: sfk web: now sets return code 1 on any error.
- add: sfk sft: now sets return code if any files were sent.
- add: del[tree] now sets return code on failure
- add: deltree now retries a failed folder deletion 2 times with a 100 msec wait inbetween.
- add: del[tree] option -stoponerr to stop chain execution if deletion fails
- chg: del[tree] now produces a warning if deletion is incomplete.
- fix: ftp client: 30 second wait after listing of directory or file download with some servers.
- fix: run: -printcmd was ignored.
- chg: zip reading: invalid zip file now produces a warning instead of an error.
- fix: xfind, replace functions, xrename: variables were not expanded for dir parameters.
- chg: sfk run: now shows a notice if no filenames are processed on chaining.
- chg: xed, xrename now ignore empty pattern parameters instead of stopping with an error. useful for scripting with optional parms.
- chg: command chaining: -verbose now shows a notice "chaining stops before ...: no data" if execution stops due to no data.
- chg: command chaining: no longer showing "chaining stops ...: no filenames" unless -verbose is given.
- chg: sfk batch out.sh under linux: added exit after sfk call.
- chg: sfk sft cput: if no files are sent then -quiet no longer tells anything.
- add: copy -flat2 to copy all files of a dir tree to an output folder with relative names.
- add: make-random-file -lock option, to keep a file locked for testing.
- fix: xfind with -justrc: chaining to if was not possible if nothing was found.
- fix: xfind -showrc produced an error.
- add: ifnotexist, check if a file does not exist.
- add: swap, reverse chain text character order
- add: Windows: sfk clock: pressing enter now resets the relative time.
- add: Windows: sfk clock3 shows overall start time and, when pressing Enter, relative time since overall start in a second column.
- add: sfk clock2 to show just a relative time.
- add: sft client: multi file send: now showing total mb info.
- add: xed: option -tolines to force line output.
- fix: xed: listing of mem leaks if given filename cannot be read, or input too large.
- doc: end: xed -tolines reference
- doc: tofile: addtovar reference
- doc: sft: upload loop example.
- doc: index: reworked linux examples.
- doc: xfind: -showrc removed, wrong context.
- doc: filter: difflines reference.
- doc: help opt: new list of archive extensions and -qarc info
- doc: xed: reference to sfk swap
- doc: sfk help chain: data tunneling notice.