The Stty command uses

Source: Internet
Author: User

Stty [ -A] [- G ] [ Options ] Stty (set TTY) commands are used to display and modify the properties of the currently registered terminal.

The UNIX system provides an important means of controlling the input and terminal output of the keyboard, which can be set by the Stty command for a specific terminal or communication line. This option is cleared when the corresponding option in Stty is preceded by a minus sign (-), which is set if no minus sign is selected.

Stty-a #将所有选项设置的当前状态写到标准输出中
old_stty_settings= ' Stty-g ' #保存当前设置
Stty "$old _stty_settings" #恢复当前设置
Stty-echo #禁止回显, does not appear on the screen when you enter it on the keyboard
Stty Echo #打开回显
Stty Raw #设置原始输入
Stty-raw #关闭原始输入
Stty IGNCR #开启忽略回车符
stty-igncr# closing the Ignore carriage return character

Example one:

[Python]View Plaincopy
      1. #!/bin/sh
      2. Stty-echo
      3. Echo-n "Please set your password:"
      4. Read P
      5. Stty Echo
      6. ECHO-E "\nyour password is: $p"

Example two:

Stty-ctlecho (equivalent to "-echoctl")

[Email protected] ~]# Stty-ctlecho
[[email protected] ~]# launch
-bash: Start: Command not found
[[Email protected] ~]# boot (ctrl + C key)
[[email protected] ~]# hahaha (CTRL + C key)
[[Email protected] ~]# I don't export (Ctrl + C key)
[[email protected] ~]# echo "SDFD" (Enter)
Sdfd

[Email protected] ~]# stty ctlecho
[Email protected] ~]# okay ^c

The Stty command uses

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.