你好,这是我在google shell中创建的文件。我希望每行增加三行,例如第一行将是699的699.我试图使用“while read line; do c =”line“c = c + 3”line“; done
答案 0 :(得分:0)
您可以使用以下脚本:
Failed to execute the statement!You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'all' or 'cash'' at line 1
创建后,您需要向用户授予执行权限:
#!/bin/bash
while read -r line || [[ -n "$line" ]]; do
echo $(($line+3));
done < "$1"
以下列方式调用之前:
chmod u+x my_script.sh
结果将保存在file.out。
中 祝你好运!<强> TODO 强>
当您的行不是数字或包含其他字符时进行错误管理。