Dr. Juande Santander-Vela<p>I've been a Kaleidoscope.app user for a long time, for sure since version 2, but maybe even from version 1, I'd have to check. In any case, I love the way they do comparisons, and is my main driver for making diffs. It integrates very well with git, for instance, and with many other tools.</p><p>But one thing I found I sometimes needed was comparing arbitrary pieces of text that I found elsewhere, and for that I was resorting to type† `ksdiff <(echo "Text 1 to compare") <(echo "Text 2 to compare")` on the terminal‡.</p><p>I ended up defining a function `ksdiffstr` like this: `ksdiffstr () { ksdiff <(echo "$1") <(echo "$2") }`, and now I can more simply time `ksdiffstr "This is a string without quotes to compare." 'This is another string with "quotes" to compare.'`, using single quotes (`'`) when there are double quotes, and I don't want to bother with the scaping (`\"`).</p><p>Hope you find it useful!</p><p>† You could do that with plan `diff` on any Unix-like system, or `opendiff` on macOS with Xcode and friends installed. It is not available just with the CLI tools (`clang` et al.) installed.</p><p>‡ Please note that `<(script expression)` — also called Process Substitution — allows you to insert as an _in-place file_ the result of a script expression. For instance, you can do `<(tail -n 1 file)` to input **as a file** the last line of that file, instead of using `tail` feeding a pipe, something that not all commands support. This is supported at least in `bash`, `zsh`, and maybe other POSIX-shells, but not `t/csh` or `sh`.</p><p><a href="https://mathstodon.xyz/tags/zsh" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>zsh</span></a> <a href="https://mathstodon.xyz/tags/bash" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bash</span></a> <a href="https://mathstodon.xyz/tags/scripting" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>scripting</span></a> <a href="https://mathstodon.xyz/tags/cli" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cli</span></a> <a href="https://mathstodon.xyz/tags/ProcessSubstitution" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ProcessSubstitution</span></a> <a href="https://mathstodon.xyz/tags/ksdiff" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ksdiff</span></a> <a href="https://mathstodon.xyz/tags/Kaleidoscope" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Kaleidoscope</span></a></p>