当前位置:首页 » 编程软件 » 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);

热点内容
给表添加字段的sql 发布:2025-03-16 02:04:29 浏览:473
1除5算法 发布:2025-03-16 02:02:57 浏览:757
oppo云密码本在哪里 发布:2025-03-16 01:57:13 浏览:534
c语言定义pi的 发布:2025-03-16 01:51:08 浏览:603
一剑破天脚本 发布:2025-03-16 01:48:03 浏览:965
dex优化编译 发布:2025-03-16 01:45:54 浏览:224
硬盘缓存路径怎么设置 发布:2025-03-16 01:45:46 浏览:960
最好的pythonide 发布:2025-03-16 01:42:56 浏览:693
androidbitmap处理 发布:2025-03-16 01:42:08 浏览:544
预算管理如何实现资源配置 发布:2025-03-16 01:33:02 浏览:615