Tag Info

New answers tagged

0

This method treats input as a string then parses and tests it for proper formatting. In this form, I have it also checking if the fields in the date are correct, but you can remove those conditionals if you don't need them. #!/bin/bash echo -n "Enter the date as YYYYMMDD >" read date if [ ${#date} -eq 8 ]; then year=${date:0:4} month=${date:4:2} ...


1

You might like the option to accept many formats and convert them to standard form; the date command can help: $ day=$(unset day; until date -d "${day:-XXX}" '+%Y%m%d' 2>/dev/null do read -p "Which day? " day done) Which day? Which day? weds Which day? friday $ echo $day 20150508


0

If you define a keybinding which consists of multiple characters, e.g. bindkey 'foo' some_zle_widget zsh has to wait until it is clear that you don't want to key in this key binding. In the above example the key stroke f will be delayed for some time. The delay will continue if you press o, but will be aborted if you press a key other than o. So, to ...


0

Autohotkey as suggested by James is better for automation of simple key entries. If these strings are always the same it's easy this way, the script can also be compiled into an executable and when neede, all you need to do is to run it or enact the hotkey event. The other option, in my opinion is the better one, is the password safe KeePass. It's open ...


0

There are multiple options that don't exactly insert text by a keyboard combination shortcut (like CMD+Q), but that 'expand' short blurbs into longer words/phrases/sentences that you define. (e.g OMW = On my way!) I historically used TextExpander on Mac, but now Mac has this capability built-in (in fact it was incredibly hard to type OMW above because it ...



Top 50 recent answers are included