
sed
hushui
Coding Since 1998
展开
-
sed macro
[lake@localhost]$ echo "href=\"./index.php@commmnd=223\"" href="./index.php@commmnd=223" [lake@localhost]$ echo "href=\"./index.php@commmnd=223\"" |sed 's/href\=\"\(.*\)\"/href\=\"\1\.html\"/g' href="./index.php@commmnd=223.html" Use [^\"]* ,...原创 2021-07-29 09:43:01 · 129 阅读 · 0 评论 -
cp filelist
# sed for empty lines' remove cat yourfilelist | sed -r '/^\s*$/d' |xargs -r cp -p -v --target-directory=/your_destnation_folder_name/原创 2021-07-27 17:16:49 · 188 阅读 · 0 评论 -
sed command line Shell: sed -i ‘s/lhu3/lake/‘ *
[lake@galaxy share]$ grep lhu3 * -R qemu/firmware/60-edk2-arm.json: "filename": "/home/lhu3/usr/share/qemu/edk2-arm-code.fd", qemu/firmware/60-edk2-arm.json: "filename": "/home/lhu3/usr/share/qemu/edk2-arm-vars.fd", qemu/firmware/6...原创 2020-08-14 15:18:10 · 214 阅读 · 0 评论 -
sed 去除字符串中的括号部分内容
$ echo " char password[10][18]; struct NetworkVariable netVars[NUM_NETWORK_VARIABLES][2]" |sed -e 's/\[[^][]*\]//g' char password; struct NetworkVariable netVars原创 2019-12-27 14:28:48 · 2332 阅读 · 0 评论 -
sed regular match
root@localhost:~$ echo "bool funname::controllerFun(UNSIGNED32 id)" |sed 's/\(.*\) \(.*\)::\(.*\)\((.*)\)/1 is \1 2 is \2 3 is \3 4 is \4/g' 1 is bool 2 is funname 3 is controllerFun 4 is (UNSIGN...原创 2019-06-26 10:51:27 · 295 阅读 · 0 评论