<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>批处理之家 - UNIX/Linux Shell</title>
    <link>https://bbs.bathome.net/forum-47-1.html</link>
    <description>Latest 20 threads of UNIX/Linux Shell</description>
    <copyright>Copyright(C) 批处理之家</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Mon, 18 May 2026 04:44:40 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>https://bbs.bathome.net/static/image/common/logo_88_31.gif</url>
      <title>批处理之家</title>
      <link>https://bbs.bathome.net/</link>
    </image>
    <item>
      <title>[已解决] 求linux mint22.2的tty下，中文显示，中文输入？</title>
      <link>https://bbs.bathome.net/thread-75704-1-1.html</link>
      <description><![CDATA[图形tty7崩溃了，挣扎着按照通义挽救，几次都不行，又不方便切换。
所以想问问tty下的中文生存内容。
谢谢大佬们
（安装zhcon就可以，虽然通义不推荐，但是其余的很多细节上因为git的资源改变而走不通，而且复杂。） ...]]></description>
      <category>UNIX/Linux Shell</category>
      <author>zzz19760225</author>
      <pubDate>Tue, 09 Dec 2025 02:05:53 +0000</pubDate>
    </item>
    <item>
      <title>awk提取两标签之间的内容的问题</title>
      <link>https://bbs.bathome.net/thread-70732-1-1.html</link>
      <description><![CDATA[input.txt的内容如下:

目标字符串
猪系队友
其他无关内容
eng_start
  需要提取的文本
  包含多行
eng_end
其他无关内容

===========

awk的代码如下

#!/usr/bin/awk -f
BEGIN {
    FS = \&quot; \&quot;
    RS = \&quot;\&quot;;          # 匹配多行记录（整个标签块）
    flag = 0;     ...]]></description>
      <category>UNIX/Linux Shell</category>
      <author>netdzb</author>
      <pubDate>Fri, 28 Mar 2025 23:12:16 +0000</pubDate>
    </item>
    <item>
      <title>求助Shell脚本异常问题set +e， trap - ERR</title>
      <link>https://bbs.bathome.net/thread-69944-1-1.html</link>
      <description><![CDATA[这样用就正常这样用yum list installed coreutils 2&gt; /dev/null | grep -q coreutils &amp;&gt; /dev/null命令还是被捕获退出码
求助，为什么？]]></description>
      <category>UNIX/Linux Shell</category>
      <author>GNGW</author>
      <pubDate>Tue, 15 Oct 2024 08:15:04 +0000</pubDate>
    </item>
    <item>
      <title>shell脚本定期向串口发送16进制数据该如何写</title>
      <link>https://bbs.bathome.net/thread-69553-1-1.html</link>
      <description><![CDATA[#!/bin/bash

# 串口设备名（根据实际情况修改，例如 /dev/ttyS0）
SERIAL_PORT=\&quot;/dev/ttyS0\&quot;

# 定义要发送的16进制数据（可以根据需要修改）
HEX_DATA=\&quot;DE AD BE EF\&quot;

# 发送数据的间隔（单位：秒）
INTERVAL=5

while true; do
    # 将16进制数据转换为字节并发送到 ...]]></description>
      <category>UNIX/Linux Shell</category>
      <author>占卜家</author>
      <pubDate>Wed, 14 Aug 2024 08:45:16 +0000</pubDate>
    </item>
    <item>
      <title>求助Linux shell脚本定时删除10天以上未修改过的文件</title>
      <link>https://bbs.bathome.net/thread-69551-1-1.html</link>
      <description><![CDATA[一个Linux shell脚本，目标是实现：每天晚上11点删除   某个目录的里面的超过10天以上未修改过的文件，请问大佬们该怎么写呢]]></description>
      <category>UNIX/Linux Shell</category>
      <author>占卜家</author>
      <pubDate>Wed, 14 Aug 2024 03:17:51 +0000</pubDate>
    </item>
    <item>
      <title>求助 shell 语法问题</title>
      <link>https://bbs.bathome.net/thread-69270-1-1.html</link>
      <description><![CDATA[[/img]
求助done附近报语法错误，find . -maxdepth 1 -type f -name \'210*\' -printf \'%f\\n\' ，已测试，没有问题，done附近有什么语法错误。

报错截图。感谢]]></description>
      <category>UNIX/Linux Shell</category>
      <author>GNGW</author>
      <pubDate>Sun, 23 Jun 2024 07:38:49 +0000</pubDate>
    </item>
    <item>
      <title>发觉 Linux Shell 下 alias 的一个缺陷：无法传递命令行参数？</title>
      <link>https://bbs.bathome.net/thread-69155-1-1.html</link>
      <description><![CDATA[刚发觉 Linux Shell 下 alias 无法传递命令行后续的参数给所定义的命令，但这么说可能又不太确切。
比如 alias test=echo
然后我执行 test 123 ，是可以回显 123 的，这么说 test 不是把 123 作为参数传递给 echo 去执行了吗？
但是 alias 是不能像批处理那样把后续的参 ...]]></description>
      <category>UNIX/Linux Shell</category>
      <author>DOSforever</author>
      <pubDate>Sat, 01 Jun 2024 15:14:47 +0000</pubDate>
    </item>
    <item>
      <title>这个makefile如何写</title>
      <link>https://bbs.bathome.net/thread-68835-1-1.html</link>
      <description><![CDATA[下面的代码，我想得到的结果是3.2，可是运行结果不对。
我还想用for每次以步长了0.1来改变START一直增加到4.2为止，该怎么写？


#makefile

START=3.1

test:
]]></description>
      <category>UNIX/Linux Shell</category>
      <author>netdzb</author>
<enclosure url="/forum/@echo $(START)+0.1" length="" type="image/jpeg" />      <pubDate>Fri, 12 Apr 2024 22:49:33 +0000</pubDate>
    </item>
    <item>
      <title>请教shell脚本把多行文本合并成一行</title>
      <link>https://bbs.bathome.net/thread-68720-1-1.html</link>
      <description><![CDATA[问题描述如下，文本文件
aaa
bbb
ccc

行数不固定，要求转成
aaa bbb ccc
这个代码应该用awk或者
sed可以实现的。比如我的
文本是windows的回车换行用
sed怎么弄啊？]]></description>
      <category>UNIX/Linux Shell</category>
      <author>netdzb</author>
      <pubDate>Tue, 26 Mar 2024 13:10:01 +0000</pubDate>
    </item>
    <item>
      <title>请教如何实现Docker结合管道命令输出日志</title>
      <link>https://bbs.bathome.net/thread-68477-1-1.html</link>
      <description><![CDATA[我尝试用docker run 运行一个容器，会得到一个镜像ID，通过docker logs 可以查看该id日志。我想做成一个管道命令,例如 docker run xx| docker logs xargs ，但是这个写法不能正确输出日志，请问大家如何修改，谢谢。

 ...]]></description>
      <category>UNIX/Linux Shell</category>
      <author>codecook</author>
      <pubDate>Tue, 27 Feb 2024 04:48:35 +0000</pubDate>
    </item>
    <item>
      <title>Linux应急处置/信息搜集/漏洞检测Shell脚本</title>
      <link>https://bbs.bathome.net/thread-67917-1-1.html</link>
      <description><![CDATA[Linux应急处置/信息搜集/漏洞检测工具，支持基础配置/网络流量/任务计划/环境变量/用户信息/Services/bash/恶意文件/内核Rootkit/SSH/Webshell/挖矿文件/挖矿进程/供应链/服务器风险等13类70+项检查

【使用方法】

联网状态：

[*]apt-get install silversearcher-ag
[ ...]]></description>
      <category>UNIX/Linux Shell</category>
      <author>Batcher</author>
      <pubDate>Fri, 24 Nov 2023 04:19:52 +0000</pubDate>
    </item>
    <item>
      <title>gawk怎样排列指定字段顺序</title>
      <link>https://bbs.bathome.net/thread-66942-1-1.html</link>
      <description><![CDATA[gawk  
如果他们日期和时间分秒相同，空格视为分隔符,  如果其第5和6列字段含有指定字符串,  则根据指定字符串按先后行重新还原排列
如果日期和时间不同, 则按原排列

    例如指定要排列字符串行顺序   
    |*公司*|*企业*|*名称*|*货号*|*编号*|*品类*|


test.txt   ...]]></description>
      <category>UNIX/Linux Shell</category>
      <author>娜美</author>
      <pubDate>Tue, 01 Aug 2023 11:42:03 +0000</pubDate>
    </item>
    <item>
      <title>[已解决]求shell脚本根据文件名开头字符创建文件夹并移动文件</title>
      <link>https://bbs.bathome.net/thread-65815-1-1.html</link>
      <description><![CDATA[文件夹下面有很多英文名是文件，要求把a开头的放在a的文件夹下面，
b开头的放在b开头的文件夹下面，以此类推，应该怎么写呢？
谢谢！]]></description>
      <category>UNIX/Linux Shell</category>
      <author>netdzb</author>
      <pubDate>Fri, 14 Apr 2023 03:20:36 +0000</pubDate>
    </item>
    <item>
      <title>Shell脚本怎样按列合并变量？</title>
      <link>https://bbs.bathome.net/thread-65572-1-1.html</link>
      <description><![CDATA[两个变量，怎么按列合并，比如，a b 合并成 c
类似 paste]]></description>
      <category>UNIX/Linux Shell</category>
      <author>newswan</author>
      <pubDate>Mon, 20 Mar 2023 09:54:49 +0000</pubDate>
    </item>
    <item>
      <title>[分享]awk和grep对比两个文件删除指定列重复行</title>
      <link>https://bbs.bathome.net/thread-64725-1-1.html</link>
      <description><![CDATA[【问题描述】

如何读取a.txt内容，匹配b.txt已/分隔符第5列前12位的字符串，匹配则删除b.txt的匹配行。]]></description>
      <category>UNIX/Linux Shell</category>
      <author>Batcher</author>
      <pubDate>Tue, 20 Dec 2022 02:46:01 +0000</pubDate>
    </item>
    <item>
      <title>linux正则匹配行末尾和文件末尾时不一致</title>
      <link>https://bbs.bathome.net/thread-64403-1-1.html</link>
      <description><![CDATA[数据
{001{AAA}ABC}
{002{BBB}ABC}

目的：将行首的{和行尾}的符号替换\&quot;(双引号）

当使用正则表达式 ^{ 可以匹配到所有以{开头的行，但是用 \\}$ 就只能匹配到非最后一行的内容，文件末尾的}就总是无法替换，

请高手指教，谢谢 ...]]></description>
      <category>UNIX/Linux Shell</category>
      <author>shootman2</author>
      <pubDate>Thu, 17 Nov 2022 22:27:03 +0000</pubDate>
    </item>
    <item>
      <title>[已解决]gawk如何匹配一个汉字</title>
      <link>https://bbs.bathome.net/thread-64373-1-1.html</link>
      <description><![CDATA[[]，提前感谢了]]></description>
      <category>UNIX/Linux Shell</category>
      <author>g495326</author>
      <pubDate>Tue, 15 Nov 2022 00:52:12 +0000</pubDate>
    </item>
    <item>
      <title>求awk分隔符写法</title>
      <link>https://bbs.bathome.net/thread-63829-1-1.html</link>
      <description><![CDATA[有如下记录每1个记录内有等4种分隔符（不含方括号[]），使用次序随机，现用awk进制分割，想要得到以下指令（在Windows下测试）分隔符（-F\&quot;????\&quot;）该如何写，才能得到想要的结果感谢各位大神的教导，谢谢 ...]]></description>
      <category>UNIX/Linux Shell</category>
      <author>hfxiang</author>
      <pubDate>Tue, 20 Sep 2022 08:52:38 +0000</pubDate>
    </item>
    <item>
      <title>请教一个关于linux shell和mongodb数据库交互的问题？</title>
      <link>https://bbs.bathome.net/thread-62650-1-1.html</link>
      <description><![CDATA[以上是数据库peg里的表集合movies的内容。接下来请看我写的shell脚本请问我应该如何做才能把在mongodb中查询的值传到linux shell 中的变量来使用呢？]]></description>
      <category>UNIX/Linux Shell</category>
      <author>2565549687</author>
      <pubDate>Sat, 07 May 2022 10:11:22 +0000</pubDate>
    </item>
    <item>
      <title>大佬们，Linux shell sed代码替换求助</title>
      <link>https://bbs.bathome.net/thread-61876-1-1.html</link>
      <description><![CDATA[各位大佬好，Linux shell sed代码替换求助，请问如何用sed命令替换代码？

想实现把代码的
a=$(ip address | grep ^[0-9] | awk -F: \'{print $2}\' | sed \&quot;s/ //g\&quot; | grep \'^[e]\' | grep -v \&quot;@\&quot; | grep -v \&quot;\\.\&quot;)
替换成
a=$(ip address | grep ^[0-9] | awk -F: \'{print  ...]]></description>
      <category>UNIX/Linux Shell</category>
      <author>smdx</author>
      <pubDate>Fri, 11 Mar 2022 02:26:40 +0000</pubDate>
    </item>
  </channel>
</rss>