| 查看: 415 | 回复: 0 | |||
[交流]
2016-03-06(文件描述符和重定向)
|
|
2016-03-06 文件描述符和重定向 0--stdin(标准输入) 1--stdout(标准输出) 2--stderr(标准错误) 为读取文件创建一个文件描述符: $ echo this is a test line > input.txt $ exer 3<input.txt #使用文件描述符3打开并读取文件 $ cat <&3 this is a test line 创建一个文件描述用于写入(截断模式): exec 4>output.txt echo newline >&4 cat output.txt 数组和关联数组 $ declare -A fruits_value $ fruits_value=([apple]='100dollars' [orange]='150 dollars') $ echo "Apple costs ${fruits_value[apple]}" Apple costs 100 dollars echo ${array_var[0]} #打印出特定索引的数组元素内容 index=5 echo ${array_var[$index]} echo ${array_var echo ${array_var[@]} echo ${#array_var |
» 猜你喜欢
厦门大学侯旭团队招聘青年教师、博士后及博硕士研究生
已经有2人回复
哈工大深圳 表界面物理化学方向(胶体与界面,光谱探测研究) 博士招生
已经有0人回复
物理化学论文润色/翻译怎么收费?
已经有278人回复
元素硫的化合价和氧化态
已经有1人回复
江苏科技大学2026年招聘启事
已经有1人回复
求助:三乙酰丙酮铁(Fe(acac)₃)标准红外(IR)与XRD谱图/数据
已经有1人回复
International Journal of Nanoscience属于中科院4区吗?
已经有0人回复
微纳hub,微纳加工的宝库
已经有0人回复
微纳加工里的 lift-off 工艺
已经有0人回复
澳大利亚南昆士兰大学量子点课题组招收博士生
已经有0人回复
香港中文大学(深圳)2026年招聘公告
已经有0人回复










回复此楼