UTFOUT(1) | General Commands Manual | UTFOUT(1) |
utfout - utility for producing UTF-8 output to standard streams and terminal.
utfout [OPTION]... [STRING]...
Echo strings to specified output stream(s).
-u, --file-descriptor=<fd> Write to specified file descriptor.
utfout recognises C-style escape sequences as used by printf(1) . By default an escape sequence is introduced by the backslash character ('\'), however this may be changed with the -p option. utfout also supports some additional sequences:
utfout also supports range escapes which allow a range of characters to be specified in a compact format.
Note that ranges take two values of the same type and the maximum width for that type must be specified.
<num>ns : nano-seconds (1/1,000,000,000 second) <num>us : micro-seconds (1/1,000,000 second) <num>ms : milli-seconds (1/1,000 second) <num>cs : centi-seconds (1/100 second) <num>ds : deci-seconds (1/10 second) <num>s : seconds <num>m : minutes <num>h : hours <num>h : days <num> : seconds If <num> is -1, wait until any signal is received. If signal is SIGNUM continue, else exit immediately.
# Print "foofoofoo" to stderr, followed by "barbar" to stdout. utfout "foo" -r 2 -o "bar" -r 1 # Write 50 nul bytes direct to the terminal. utfout -t "" -r 49 # Write continuous stream of nul bytes direct to the terminal, # 1 per second. utfout -b 1s -t '' -r -1 # Display a greeting slowly (as a human might type) utfout -b 20cs "Hello, $USER.\n" # Display a "spinner" that loops 4 times. utfout -b 20cs -p % "%r|%r/%r-%r\%r" -r 3 # Display all digits between zero and nine with a trailing # newline. utfout "\{0..9}\n" # Display slowly the lower-case letters of the alphabet, # backwards without a newline. utfout -b 1ds "\{z..a}" # Display upper-case 'ABC' with newline. utfout '\u0041\u0042\u0043\n' # Display 'foo' with newline. utfout '\o146\u006f\x6F\n' # Clear the screen. utfout '\n' -r $LINES # Write hello to stdout, stderr and the terminal. utfout 'hello' -t -r 1 -e -r 1 # Display upper-case letters of the alphabet using octal # notation, plus a newline. utfout "\{\o101..\o132}" # Display 'h.e.l.l.o.' followed by a newline. utfout -a . "hello" -a '' "\n" # Display upper-case and lower-case letters of the alphabet # including the characters in-between, with a trailing newline. utfout "\{A..z}\n" # Display lower-case alphabet followed by reversed lower-case alphabet # with the digits zero to nine, then nine to zero on the next line. utfout "\{a..z}\{z..a}\n\{0..9}\{9..0}\n" # Display lower-case Greek letters of the alphabet. utfout "\{α..ω}" # Display cyrillic characters. utfout "\{Ѐ..ӿ}" # Display all printable ASCII characters using hex range: utfout "\{\x21..\x7e}" # Display all printable ASCII characters using 2-byte UTF-8 range: utfout "\{\u0021..\u007e}" # Display all printable ASCII characters using 4-byte UTF-8 range: utfout "\{\U00000021..\U0000007e}" # Display all braille characters. utfout "\{\u2800..\u28FF}" # Display 'WARNING' in white on red background. utfout '\e[37;41mWARNING\e[0m\n' # Generate 10 random characters. utfout '\g' -r 9
Written by James Hunt <james.hunt@ubuntu.com>
Copyright © 2012 James Hunt <james.hunt@ubuntu.com>
GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO
WARRANTY, to the extent permitted by law.
2012-09-10 | User Commands |