shell - 从循环内部读取 ASCII 文件,每次迭代读取 shell 脚本中的一行
问题描述
我想在while
-loop 中读取一个 ASCII 文件,每次迭代我想从文件的第二行开始读取每一行。经过大量搜索后,我想出了以下内容:
a=1
while [ $a -le 04 ]
do
while read p q r; do
root -l macro.C\($r\) #the operation is dependent of the entries of the third column in the ASCII file
done < ascii.txt
a=`expr $a + 1`
done
但是,这似乎不符合我的目的。首先,我想跳过第一行,但不知道该怎么做。此外,它的作用是为外部循环的每次迭代提供该列的所有条目while
。
有人可以帮我吗?
谢谢和问候, Saumyen
解决方案
推荐阅读
- reactjs - 更新反应状态中的字典列表
- swift - 无法创建 Firebase 集合
- powershell - 如果写入文件,Get-PnpDevice 不起作用
- blazor - 未处理的异常呈现组件:“<”是 Blazor WASM 值的无效开始
- javascript - YT 播放器在悬停时删除个人资料图片和 youtube 徽标
- python - 将 PySimpleGUI 窗口变量导入另一个文件
- microsoft-graph-api - 当我的机器人安装到新团队时,我不会收到 conversationUpdate (membersAdded) 事件有什么原因吗?
- tcp - Wireshark - TCP SYN、SYN ACK 和来自服务器的确认号
- python - 使用 Docker 部署烧瓶应用程序失败并显示“context.load_cert_chain('cert.pem','key.pem') FileNotFoundError: [Errno 2]”
- javascript - Todolist 中的 Sortable.js