當前位置:首頁 » 編程軟體 » 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);

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:585
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:881
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:574
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:761
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:678
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:1005
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:251
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:108
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:799
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:705