1. 程式人生 > 其它 >用Shell 語言編制一Shell 程式,該程式在使用者輸入年、月之後,自動列印數出該年該月的日曆。

用Shell 語言編制一Shell 程式,該程式在使用者輸入年、月之後,自動列印數出該年該月的日曆。

技術標籤:Linuxlinuxshell

操作步驟如下:

  1. 在vi/vim編輯器下建立Shell指令碼:cal_month_year.sh
  2. 檔案主要命令列:
#!/bin/bash
#Show cal month of year

echo -n "Please input the month:"
read month

echo -n "Please inout the year:"
read year

cal $month $year

  1. 賦予許可權777
  2. 然後執行:cal_month_year.sh

輸出結果圖
請幫頂 / 評論點贊!你們的鼓勵是我寫作的最大動力!