Skip to content

Benjr.tw

  • Linux
    • Stress & Performance
    • Hardware Info
    • System Monitor
    • Security
    • Desktop
    • PXE
    • Filesystem Hierarchy Standard
    • Linux 開機選項
    • Linux Package Manager
    • 備份 Backup
  • Virtualization
    • Docker & Podman
    • CoreOS
  • NAS/SAN
  • Programming Language
    • Python
    • Bash shell script
    • Perl
    • PHP
    • Node.JS
    • VBA
    • javascript
    • Power Query
    • PowerShell
  • WordPress
  • DataBase
    • 資料庫安裝
    • 資料庫語法
    • SQLite
    • MariaDB JSON

Programming Language

Bash Shell Script – eval

2023-07-272023-07-27 adminBash shell script, Linux, RedHat / CentOS

Loading

測試環境為 CentOS8 (虛擬機) 在 Linux shell 會將變數轉換成字串,缺點是當變數是指令時,也只會當作字串. 這時候透過 eval 指令就可以先將後面 的參數替換成字串,再把全部當作指令到 Shell 來執行. eval 格式:

Read more

Excel Power Query – Excel.Workbook & Excel.CurrentWorkbook

2022-11-102022-11-10 adminPower Query, Windows

Loading

測試環境 Windows 10 + Excel 2016 透過 Excel 的 Power Query 下面指令可以讀取到 Excel 的表格資料(資料須先做成表格). Excel.CurrentWorkbook – https://learn.microsoft.com/zh-tw/p […]

Read more

Linux – 取代文字檔案內字串

2021-09-102021-12-08 adminBash shell script, Linux

Loading

除了使用文字編輯器改變 TEXT (.txt) 文字檔案內容外,我們可以透過 sed 指令來處理. 先來產生一個文字檔. 透過 sed 的 s/regexp/replacement/ , 符合 regexp (正規表示式) 的字串會取代 replacement 字串,但同一行有多個符合 regexp […]

Read more

Bash shell script – function

2019-01-242019-01-24 adminBash shell script, Linux, RedHat / CentOS

Loading

測試環境為 CentOS7 x86_64 (虛擬機) 參考文章 – https://ryanstutorials.net/bash-scripting-tutorial/bash-functions.php Linux Bash shell script 使用函數 function 參考 […]

Read more

Linux – Perl 使用 Proxy

2018-06-062018-06-06 adminLinux, Perl, RedHat / CentOS

Loading

當 Perl 安裝模組透過 cpan 或是 cpanm 時須透過 公司 Proxy 時,這時候可以在 perl 的 shell 來進行設定. 設定 Proxy 進入 perl 的 shell 來進行設定,透過 o conf http_proxy 先觀察有無設定過 . 透過 o conf init / […]

Read more

Linux – Perl & Modules

2018-05-302018-06-06 adminLinux, Perl, RedHat / CentOS

Loading

安裝 Perl – Practical Extraction and Report Language , 測試環境為 CentOS 7 x64 (虛擬機) 前置作業 – 所需套件 Perl 在 CentOS 7 使用版本為 perl 5, version 16, subversion 3 […]

Read more

Linux – PHP + Mysql

2018-01-022020-03-16 adminLinux, PHP, Ubuntu

Loading

要如何透過 PHP 來讀取 Mysql (MariaDB) 的資料. 測試環境為 Ubuntu 16.04 x86_64 + Apache2 虛擬機 (IP: 172.16.15.130) 請參考 https://benjr.tw/95861 , web server 為 Nginx + Maria […]

Read more

Bash shell script 輸出 IP Address

2017-07-122017-07-13 adminBash shell script, Linux

Loading

透過 sed 與 awk 都可以把文件做過濾和轉換成新的輸出內容.不過 sed 適合用於一整行的資料處理,而 awk 則比較適合將一整行做多個 欄位 的資料處理.先來看看 sed 的範例. 只想把 ifconfig 網卡裝置 ens33 過濾剩下 IP Address 的輸出,這時候需要配合 gre […]

Read more

Linux command – tr

2017-07-122017-07-12 adminBash shell script, Linux

Loading

tr – (translate or delete characters ) 這個指令可以用來做字元的取代或是刪除.tr 只能針對字元來處理,如果要對字串做處理的話,必須使用 sed 來處理, 請參考 https://benjr.tw/97129 下面是他常用的參數. -d, &#821 […]

Read more

Linux command – awk 資料的列轉行

2017-07-112017-07-12 adminBash shell script, Linux

Loading

透過 sed 與 awk 都可以把文件做過濾和轉換成新的輸出內容.不過 sed – https://benjr.tw/97129 適合用於一整行的資料處理,而 awk 則比較適合將一整行做多個 欄位(Field) 的資料處理.先來看看 awk 的幾個範例. awk 是 mawk 的連結, […]

Read more

文章導覽

較舊的文章

近期文章

  • Windows – Network Sharing + Port forwarding to VM
  • Ansible – gather facts
  • Ansible – host_vars 定義特定的變量
  • Ansible 範例 – Chrony daemon
  • Ubuntu NTP Client 校時設定

近期留言

  • 「Jackson2734」於〈Ubuntu NTP Client 校時設定〉發佈留言
  • 「w」於〈Ubuntu 16.04 Server PXE 安裝〉發佈留言
  • 「admin」於〈TCP/IP 常見封包〉發佈留言
  • 「stu」於〈TCP/IP 常見封包〉發佈留言
  • 「student」於〈Linux command – tcpdump〉發佈留言

分類

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文
  • Privacy Policy
  • 隱私權政策
Powered by WordPress | Theme: Astrid by aThemes.