New answers tagged

3

This is a terminal independent way of enabling the blinking attribute. If it doesn't work then either you've mis-set your terminal type, it's not enabled in the terminal characteristics, or it's simply not supported: tput blink echo hello, world tput sgr0 The terminfo database is well worth perusing (not bedtime reading, mind) to find semi-readable names ...


0

I find that gnome-terminal and its close relative mate-terminal don't support blink, but xterm does, at least partially. Even then, it only supports slow blink (code 5, not 6) and the text only blinks while the window has focus.


0

Reading source code is helpful, but the suggested examples are complicated. Most useful programs like the one OP is asking about use escape sequences via termcap or curses interfaces. Doing it with curses would be much simpler. Here are the steps needed with termcap: get the terminal description (including the cursor-movement, scrolling region, ...


1

In the ncurses terminal database, cvvis is used as documented in the terminfo manual page: cursor_visible cvvis vs make cursor very visible and if there is no difference between normal and very visible, the cvvis capability is usually omitted. The feature is used in curs_set: The curs_set ...


0

(Converted edit to answer) I used the plutil command to convert the plist to proper text since it was a 'binary file'. Once that was done, grep had no problem managing the file.


2

If you enter the string literally into the command, you can escape the characters at your will. grep 'Title of Webpage which may include '\'' and "' /var/mobile/Library/Safari/History.plist grep "Title of Webpage which may include ' and \"" /var/mobile/Library/Safari/History.plist Also notice that cat isn't needed. Moreover, it's much better to use an ...


2

It's a kind of necroposting but I've had the same problem recently (with a different backend) and found that the reason is in a wrong Content-Type. By default it's "text/plain" or "text/html", and in my case curl -H "Content-Type: application/json" -d ... solved the issue.


4

When you press Ctrl-V, the shell will start by ignoring keyboard interrupts and simply take the pressed key combination as the input character. This is easily possible as ASCII is designed to hold all control characters. Of course, on display it has to cheat a bit and show the ^ followed by the corresponding key or otherwise it would output control ...


4

The 2 and 5 come from ITU T.416 (the same as ISO 8613-6), entitled Open Document Architecture (ODA) and Interchange Format: Character Content Architectures. Quoting from ISO/IEC 8613-6 : 1994 (E), page 41: The first parameter element indicates a choice between: 0 implementation defined (only applicable for the character foreground colour) 1 ...


2

The behavior of C-m, C-i, etc. is implemented by bash, but the fact that they're the same thing as Return, Tab, etc. is due to the behavior of the terminal. All terminals behave like this because all terminals have always behaved like this and it's what applications expect. The interface between a terminal and an application is based on characters (in fact, ...


0

Two questions, two points: control/J, control/M and control/I are common ASCII controls which most programs assume. bash simply makes it easy to rebind those in readline. most programs which accept special keys such as left-arrow provide a way to recognize the escape key distinguished from those special keys by timing. You probably cannot type fast ...


2

One way to avoid having bash word-splitting is to use an array to carry each argument without any need for escaping: push(){ args[${#args[*]}]="$1"; } build() { args=() for file do push "-F" push "filedata=@$file" done } build "$@" curl --progress-bar -i "${args[@]}" https://transfer.sh | grep https The build function creates an ...


3

Give a try to this standard and safe solution: transfer() { printf -- "-F filedata=@%s\0" "$@" | xargs -0 sh -c 'curl --progress-bar -i "$@" https://transfer.sh | grep -i https' zerop } "$@" with the Double-Quotes will make the shell keeps the original options unchanged. See 2.5.2 Special Parameters section from The Open Group Base Specifications Issue ...


14

Use -R flag: -r or --raw-control-chars Causes "raw" control characters to be displayed. The default is to display control characters using the caret notation; for example, a control-A (octal 001) is displayed as "^A". Warning: when the -r option is used, less cannot keep track of the actual appearance of the screen (since this depends on ...



Top 50 recent answers are included