shell脚本|系统版本和当前时间输出到文件,并同时显示在终端

#!/bin/bash

# 获取系统版本信息
system_info=$(uname -a)

# 获取当前时间
current_time=$(date)

# 指定输出文件
output_file="system_info_and_time.txt"

# 将系统版本和当前时间输出到文件,并同时显示在终端
echo "System Information: $system_info" | tee $output_file
echo "Current Time: $current_time" | tee -a $output_file
echo "Information has been written to $output_file" | tee -a $output_file

# 将系统版本和当前时间输出到文件
#echo "System Information: $system_info" > $output_file
#echo "Current Time: $current_time" >> $output_file
#echo "Information has been written to $output_file"

评论

  1. 3 月前
    2024-4-28 4:27:41

    ” target=”_blank”>카지노솔루션 that you wish be delivering the following unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇