AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-165944

Carter's questions

Martin Hope
Carter
Asked: 2023-12-11 14:20:07 +0800 CST

如何将输出重定向到名称为当前日期和时间以及当前目录名称的文件?

  • 5

我正在尝试使用 xterm 中的当前工作目录进行重定向。

xterm -ls -geometry 80x30 -e 'cd /home/work/test1/; pwd; make | tee test1.log;'
xterm -ls -geometry 80x30 -e 'cd /home/work/temp/test2/; pwd; make | tee test2.log;'
xterm -ls -geometry 80x30 -e 'cd /home/work/tmp/test3/; pwd; make | tee test3.log;'
xterm -ls -geometry 80x30 -e 'cd /home/work/my_test4/; pwd; make | tee my_test4.log;'
xterm -ls -geometry 80x30 -e 'cd /home/work/append/my_test5/; pwd; make | tee my_test5.log;'
...

我想将输出重定向到一个文件,该文件的名称是当前日期和时间以及 xterm 中当前的最后一个目录名称。

for example).
xterm -ls -geometry 80x30 -e 'cd /home/work/append/my_test5/; pwd; make | tee my_test5_03:19:12-11-2023.log;'

如何将输出重定向到一个文件,该文件的名称是xterm中的当前日期和时间以及当前目录名称?

io-redirection
  • 1 个回答
  • 46 Views
Martin Hope
Carter
Asked: 2022-06-30 00:06:53 +0800 CST

如何在没有yum的情况下在centos5中安装libreoffice?

  • 0

我正在尝试在 CentOS 5 中安装 Libreoffice。不幸的是,我的系统与 Internet 是分开的。所以我不能使用 YUM 进行安装。

幸运的是我发现

https://downloadarchive.documentfoundation.org/libreoffice/old/3.3.4.1/rpm/x86_64/

你能指导我从哪里开始吗?我需要安装什么文件以及如何在 CentOS 5 中安装?

我只是按照https://vitux.com/how-to-install-libreoffice-on-centos-8/

但是在 yum clean 之后我收到了下面的错误信息

# yum localinstall *.rpm
Loaded plugins: fastestmirror, security
Setting up Local Package Process
Examining libobasis3.6-base-3.6.1.2-2.x86_64.rpm: libobasis3.6-base-3.6.1.2-2.x86_64
Marking libobasis3.6-base-3.6.1.2-2.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
http://vault.centos.org/5.11/os/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[worker@localhost RPMS]# 

当我检查 /etc/yum.repos.d

[worker@localhost yum.repos.d]# ll
total 4
-rwxr-xr-x 1 root root 1906 Jan  1  2018 CentOS-Base.repo

CentOS-Base.repo 如下所示

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
# http://vault.centos.org/?release=5&arch=i386&repo=os

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://vault.centos.org/5.11/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://vault.centos.org/5.11/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://vault.centos.org/5.11/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages

#更新

在 * rpm -ivh .rpm之后 ,我得到了以下内容

[worker@localhost RPMS]# rpm -ivh *.rpm
Preparing...                ########################################### [100%]
   1:libreoffice3.6-ure     ########################################### [  2%]
   2:libobasis3.6-core01    ########################################### [  4%]
   3:libobasis3.6-core02    ########################################### [  6%]
   4:libobasis3.6-core03    ########################################### [  7%]
   5:libobasis3.6-core04    ########################################### [  9%]
   6:libobasis3.6-core05    ########################################### [ 11%]
   7:libobasis3.6-core06    ########################################### [ 13%]
   8:libobasis3.6-core07    ########################################### [ 15%]
   9:libobasis3.6-en-US     ########################################### [ 17%]
  10:libobasis3.6-base      ########################################### [ 19%]
  11:libobasis3.6-impress   ########################################### [ 20%]
  12:libobasis3.6-en-US-base########################################### [ 22%]
  13:libobasis3.6-en-US-calc########################################### [ 24%]
  14:libobasis3.6-en-US-math########################################### [ 26%]
  15:libobasis3.6-en-US-res ########################################### [ 28%]
  16:libobasis3.6-en-US-writ########################################### [ 30%]
  17:libobasis3.6-calc      ########################################### [ 31%]
  18:libobasis3.6-draw      ########################################### [ 33%]
  19:libobasis3.6-images    ########################################### [ 35%]
  20:libreoffice3.6         ########################################### [ 37%]
  21:libobasis3.6-math      ########################################### [ 39%]
  22:libobasis3.6-writer    ########################################### [ 41%]
  23:libobasis3.6-binfilter ########################################### [ 43%]
  24:libobasis3.6-extension-########################################### [ 44%]
  25:libobasis3.6-extension-########################################### [ 46%]
  26:libobasis3.6-extension-########################################### [ 48%]
  27:libobasis3.6-extension-########################################### [ 50%]
  28:libobasis3.6-extension-########################################### [ 52%]
  29:libobasis3.6-extension-########################################### [ 54%]
  30:libobasis3.6-extension-########################################### [ 56%]
  31:libobasis3.6-extension-########################################### [ 57%]
  32:libobasis3.6-extension-########################################### [ 59%]
  33:libobasis3.6-gnome-inte########################################### [ 61%]
  34:libobasis3.6-graphicfil########################################### [ 63%]
  35:libobasis3.6-javafilter########################################### [ 65%]
  36:libobasis3.6-kde-integr########################################### [ 67%]
  37:libobasis3.6-ogltrans  ########################################### [ 69%]
  38:libobasis3.6-onlineupda########################################### [ 70%]
  39:libobasis3.6-ooofonts  ########################################### [ 72%]
  40:libobasis3.6-ooolinguis########################################### [ 74%]
  41:libobasis3.6-postgresql########################################### [ 76%]
  42:libobasis3.6-pyuno     ########################################### [ 78%]
  43:libobasis3.6-xsltfilter########################################### [ 80%]
  44:libreoffice3.6-base    ########################################### [ 81%]
  45:libreoffice3.6-calc    ########################################### [ 83%]
  46:libreoffice3.6-dict-en ########################################### [ 85%]
  47:libreoffice3.6-dict-es ########################################### [ 87%]
  48:libreoffice3.6-dict-fr ########################################### [ 89%]
  49:libreoffice3.6-draw    ########################################### [ 91%]
  50:libreoffice3.6-en-US   ########################################### [ 93%]
  51:libreoffice3.6-impress ########################################### [ 94%]
  52:libreoffice3.6-math    ########################################### [ 96%]
  53:libreoffice3.6-stdlibs ########################################### [ 98%]
  54:libreoffice3.6-writer  ########################################### [100%]

但是100%之后就什么都没有了。如何启动 libreoffice?我还需要别的吗?

centos libreoffice
  • 2 个回答
  • 45 Views
Martin Hope
Carter
Asked: 2020-01-31 19:05:03 +0800 CST

如何在 Cshell 中读取和替换两个参数文件?

  • 0

我正在尝试制作一个自动替换文本文件中单词的脚本。

In a.v,
BIRA_0     0
BIRA_1     400
BIRA_2     800
BIRA_3     C00
...

in b.v,
BIRA_0[25:0]
BIRA_0[95:26]
BIRA_0[125:96]
BIRA_0[255:125]
BIRA_1[5:0]
BIRA_1[25:6]
...


Result,

0[25:0]
0[95:26]
0[125:96]
0[255:125]
400[5:0]
400[25:6]
...

当然,我可以使用

$sed "s/BIRA_0/0/" b.v > result

但问题是该文件a.v包含许多这样的替换案例,所以我想通过 Cshell 脚本自动制作。

csh
  • 1 个回答
  • 59 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve