當前位置:首頁 » 編程軟體 » shell腳本分號

shell腳本分號

發布時間: 2023-08-23 15:05:00

『壹』 怎麼設置 linux環境變數配置

1、直接用export命令:
#export PATH=$PATH:/opt/au1200_rm/build_tools/bin
查看是否已經設好,可用命令export查看:
[root@localhost bin]# export
declare -x BASH_ENV="/root/.bashrc"
declare -x G_BROKEN_FILENAMES="1"
declare -x HISTSIZE="1000"
declare -x HOME="/root"
declare -x HOSTNAME="localhost.localdomain"
declare -x INPUTRC="/etc/inputrc"

『貳』 shell腳本如何將文件多行根據分號拼接為一行

Hello,這個題目如果是linux必須要用linux三劍客了.

[root@g01files]#catsql.txt
createtabletest.two
(
pnvarchar(10)notnull
);
createtabletest.aa
(
pnvarchar(10)notnull
);
createtabletest.bb
(
pnvarchar(10)notnull
);
createtabletest.ccc
(
pnvarchar(10)notnull
);

方法1
[root@g01files]#awk'{if(/);/)print;elseprintf$0" "}'sql.txt
createtabletest.two(pnvarchar(10)notnull);
createtabletest.aa(pnvarchar(10)notnull);
createtabletest.bb(pnvarchar(10)notnull);
createtabletest.ccc(pnvarchar(10)notnull);

方法2
[root@oldboye-show01/server/files]#awk-vRS=");"-F" "'{print$1,$2,$3,$4,RT}'sql.txt
createtabletest.two(pnvarchar(10)notnull);
createtabletest.aa(pnvarchar(10)notnull);
createtabletest.bb(pnvarchar(10)notnull);
createtabletest.ccc(pnvarchar(10)notnull);

熱點內容
wincachephp 發布:2025-09-19 00:30:28 瀏覽:859
如何給文件夾設置圖標 發布:2025-09-19 00:06:09 瀏覽:747
火車頭密碼指紋鎖多少錢 發布:2025-09-18 23:16:55 瀏覽:135
雪佛蘭最高配置長什麼樣 發布:2025-09-18 23:16:54 瀏覽:169
網路通話源碼 發布:2025-09-18 23:07:23 瀏覽:88
asp如何購買伺服器 發布:2025-09-18 22:46:24 瀏覽:674
網頁加密代碼 發布:2025-09-18 21:56:12 瀏覽:173
安卓targz解壓 發布:2025-09-18 21:45:58 瀏覽:808
怎麼設置手機屏幕密碼怎麼設置 發布:2025-09-18 21:44:18 瀏覽:825
直線插補演算法 發布:2025-09-18 21:22:49 瀏覽:662