我有4个以下的文件
a_ROLLBACK2to3__test.sql,
a_1to2__test.sql,
a_2to3__test.sql,
a_2to2__test.sql
Run Code Online (Sandbox Code Playgroud)
我想写一个find命令来返回文件a_1to2__test.sql,a_2to3__test.sql并且a_2to2__test.sql该文件a_ROLLBACK2to3__test.sql不应该包含在搜索中.
我的find命令看起来像
find . -name "*_*to*__*.sql"
Run Code Online (Sandbox Code Playgroud)
但这会返回所有文件,但我不想要a_ROLLBACK2to3__test.sql.
基本上不应该包括ROLLBACK第一个之后的文件_..
任何人都可以帮我写出我的要求的搜索模式吗?
谢谢
我写一个unix bash shell脚本.
我想用下划线("_")替换文本中的所有无效字符.我的有效字符列表是az,AZ,"_"和0-9.基本上它是字母数字和_.在下面的例子中
#!/bin/bash
hostname=soa.ax-123
Run Code Online (Sandbox Code Playgroud)
我希望将变量hostname值替换为soa_ax_123
任何人都可以帮我写登录,找到并用"_"替换无效字符
先谢谢克里斯