[英]Bash script: how do I read a variable content from file file and increment it +1
[英]How do I read arguments from “read” in bash?
標題所說的是我的問題,如何檢查並從“讀取語句”中獲取 arguments 到 $1、$2 等...
您可以使用set
來設置位置參數的值。
$ read a b <<< "hello world"
$ set -- "$a" "$b"
$ echo "$1"
hello
$ echo "$2"
world
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.