gpt4 book ai didi

shell - 在shell脚本的for循环中使用sqlite3会产生错误

转载 作者:行者123 更新时间:2023-12-03 19:31:54 25 4
gpt4 key购买 nike

需要从目录中的每个文件中查询某个值并将其放入文件中。我使用代码:

#!/bin/bash 

ls -lrt | grep -w "458752" | awk '{print $9}' | sort -V > list

for linename in cat list
do

/d/home/alima0152/Desktop/sqlite3 $linename "select trace_count from volume"; >> trc_count

done

rm list


但是我得到这个错误:


文件已加密或不是数据库

最佳答案

该代码试图打开文件catlist

要执行某些操作并插入其输出,请使用`...`$(...)

for linename in $(cat list)

关于shell - 在shell脚本的for循环中使用sqlite3会产生错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40065944/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com