cost 326 ms
impala 查询无法在 shell 脚本中执行“date”命令

[英]impala query failed to execute `date` command in shell script

我在 shell 脚本上运行了以下 imapala 查询,该脚本抛出错误。 带反引号的日期`date` 错误:ParseException:第 1 行中的语法错误:select concat(substring(Tue Jan 17 02:18:20 EST 2023,3,2... ...

如何在 Linux 上通过 SSH 转发 dmesg live output

[英]How to forward dmesg live output through SSH on Linux

在 VMWare 或裸机上,Linux 默认将实时 dmesg 内容直接显示到标准输出。 但是当我通过 SSH 连接时,即使命令成功也没有显示如何通过 SSH 转发每个 dmesg 日志? dmesg -wH 、 watch或tail不是我要找的。 我不想看到整个 dmesg,只看到实时的,并 ...

获取包含特定模式的两个匹配模式之间的文件行

[英]Get the lines of a file between two matching patterns which contains a specific pattern

我正在尝试使用 XML 文件,例如:<clients> <client> <name>Bob</name> <age>18</age> </client> &l ...

2023-01-17 15:04:49   3   47    shell  
隐藏命令,在shell中只得到output

[英]Hide command and get only output in shell

我正在研究用于迁移的 pressly/goose 工具。 我的所有命令都从 docker 容器内的 shell 脚本文件运行。 我想从控制台 output 日志中隐藏某些命令或密码。 这是命令, goose postgres "user=postgres password=postgres dbn ...

Function output 重定向到文件在 shell 脚本中不起作用

[英]Function output redirection to file doesn't work in shell script

我写了一个基本的 shell 脚本,它接受log*.zip (从 GitHub 操作下载),搜索特定文件中的所有匹配行,并以表格形式输出匹配的行。 这是源代码的(相关)部分:-#!/bin/bash .... FILENAME=$1 shift OUT_FN=$1 ...

2023-01-17 08:58:33   1   27    bash / shell  
遍历大型数据集中的子目录,使用子目录名称创建一个新文件夹,然后将 select 个文件硬链接到该新目录

[英]Looping through sub dirs in large data set, making a new folder with the subdir name, & then hardlinking select files to that new directory

我正在努力让嵌套的 for 循环为此工作。 我正在使用的数据集非常大(超过一百万个文件)。 我正在查看嵌套的 for 循环,但它似乎不稳定。 ^^ 这只是进入最后一个目录并找到第三个文件。 我需要它进入每个目录并找到第三个文件我考虑过将其分解成块并运行多个脚本而不是一个脚本以使其更具可扩展性。 ...

是否声明字典

[英]Is dictionary declared

有没有办法检查 shell 中声明的字典? 有一种方法可以检查变量是否为空,也有一种方法可以检查字典是否有键,但不确定检查字典是否存在的正确方法是什么。 我想我已经找到了解决方案declare -A dictionary dictionary[key]="val" if [[ -z $(decla ...

2023-01-16 19:24:50   3   55    bash / shell  
shell 脚本,通过读取文件并从源和目标复制

[英]shell script by read a file and copy from source and destination

我想通过读取如下文件来创建 shell 脚本。 我想自动执行以下任务。 等等.... [![在此处输入图片描述][1]][1] 我的脚本如下 但我只想将它的源和目标放入 scp 命令 ...

如何运行 docker-compose up --build 静默

[英]How to run docker-compose up --build silently

命令docker-compose up --build将 output 构建过程和--quiet 、 --quiet-pull或--log-level ERROR等选项将不起作用。 我也没有在文档中找到任何其他选项。 任何帮助表示赞赏。 ...

仅在 linux 中删除目录 > x 天

[英]delete directories only in linux for directories > x days

我想编写一个脚本并删除 > x 天的目录/文件并忽略文件在目录中的年龄所以只停留在当前级别我有这个: 但是,第一行不返回任何目录,如果我将 -maxdepth 更改为 2,它会返回二级文件。 我想删除 /home/terry 中超过 10 天的目录。 ...

2023-01-16 11:57:09   1   68    bash / shell  
用户数据部分工作但未在 ec2 启动时安装 boto3,必须明确安装它

[英]userdata partially working but not installing boto3 on ec2 launch, have to explicitly install it

我的 ec2 的用户数据脚本: 文件 processor.py 是从我的 github 中提取的,我确实看到了它,但它没有启动,因为它需要 boto3 - 给出错误 我必须等到它在 aws gui 中显示“2/2 检查通过”,然后连接,然后明确键入“pip3 install boto3 --user ...

如何使用 bash 脚本从日志文件中查找未使用的 API?

[英]How to find unused API from the log file using bash script?

目标是找出过去 7 天未使用的 API。 有一个文件存储所有 API 列表,以及一个包含每日日志数据的文件夹。 api.txt (存储所有api列表): 日志数据(保存7天): 每个日志文件看起来像这样 方法: 从api数据(/api/user/status)的第一行开始,将log文件夹中的文 ...

在 Zeek(例如 main.zeek)中,我如何使用来自另一个脚本(egsh 文件)的变量与 packet_source() 或任何 function?

[英]In Zeek (e.g. main.zeek), how can I use the variable from another script (e.g .sh file) with packet_source() or any function?

我在 .sh 文件中的命令正在运行。 命令是:( $ZEEK -C -r $i dir ) i :要处理的pcap(文件)名称 dir : 要提取的目录命令运行时,解压文件位于所需位置。 它工作得很好。 但我需要 main.zeek 中的文件名。 问题是我如何访问 main.zeek 中的文件名 ...

无法 bash 脚本中的命令 grep output

[英]Unable to grep output of a command in bash script

以下脚本未按预期运行 output 预计 output 我已经关注了这篇文章我尝试了什么:我将“docker.pkg.github.com/private-repo/centos7”替换为回显“来自守护程序的错误响应:未授权”,它给出了匹配的预期 o/p。 所以,我在这里理解的是来自命令“doc ...

需要拆分文件名形式 _ shell 脚本中的一些数字

[英]Need to split file name form _ some number in shell script

我在目录中有一些文件,需要按 _ 编号拆分它们示例:我有像 ODRD_AzureData_Linux_x64_19.1.0.0.7.tar 这样的文件, 我想把它分成名称:ODRD_AzureData_Linux_x64 版本:19.1.0.0.7 我试过这个没有得到结果: name='$filen ...

2023-01-16 05:39:50   3   44    shell  
Integer expression expected giving for below script in the if statement......这个`expr $num%$i`在与echo一起使用时给出%......为什么这样?

[英]Integer expression expected giving for below script in the if statement......This `expr $num%$i` gives % when used with echo...Why so?

if 语句中的这个expr $num%$i在与 echo 一起使用时给出 %....为什么这样? 为什么 expr 没有按照模运算符进行评估 ...

如何替换参数的值

[英]How to replace the values of a Param

如何逐步替换参数值。 我的意思是, 例如- Url 是https://example.com/?p=first&q=second&r=third 首先,我想在 p 参数https://example.com/?p=123&q=second&r=third上添加“123 ...

尝试使用 exec.Command 运行 gofmt -r 时出现“rune literal not terminated”错误

[英]"rune literal not terminated" error when attempting to run gofmt -r with exec.Command

在以下目录结构中, 我有一个带有简单类型定义的foo.go :package main type Foo struct { Baz string } 如果我从命令行运行gofmt -r来替换变量名,它会起作用: 但是,如果我尝试使用程序从main.go执行此操作package main ...

发出 Linux 查找命令

[英]Issue with Linux find command

我编写了一个脚本来创建一个文件数组,这些文件在 1 天前被修改过,遍历该数组并以交互方式删除它们。 不知何故脚本不工作。 下面是代码: 这个脚本没有删除任何东西。 我有一些文件是在 1 月 12 日创建的,之后没有动过,但它们仍然存在。 如果这里缺少什么,你能提一下吗? ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM