“menggemakan beberapa garis bash” Kode Jawaban

bash membaca beberapa baris dari pengguna

# Basic syntax:
read -d "~" -p $'Enter your text (type \"~~\" when done):\n' YOUR_TEXT
# Where:
#	- -d tells read to continue reading until the specified delimiter is read.
#		Here I use ~ as the delimiter
#	- -p indicates what to prompt when the script asks for input. I include a
#		message to indicate what to type to stop reading. (I say ~~ because in
#		my shell, I always seem to have to press it twice to stop reading)
#	- YOUR_TEXT is the bash variable that will get the input text 
Charles-Alexandre Roy

Bash Multiline ECH

cat <<EOT >> my_file.txt
my text line 1
my text line 2
EOT
Dangerous Dragonfly

menggemakan beberapa garis bash

# This will output whatever is between the EOF tokens.
cat << EOF
usage: up [--level <n>| -n <levels>][--help][--version]

Report bugs to: 
up home page:
EOF

# You could change the EOF to whatever you want. For example:
cat << MY_TOKEN
bluh
bluh 
bliy
MY_TOKEN
Powerful Puma

Jawaban yang mirip dengan “menggemakan beberapa garis bash”

Pertanyaan yang mirip dengan “menggemakan beberapa garis bash”

Lebih banyak jawaban terkait untuk “menggemakan beberapa garis bash” di Shell/Bash

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya