※ 引述《IAMPF (PF)》之銘言:
: 如果說我要寫個程式用C++或是C
: 或是shell script來讓firefox打開指定網頁
: 最好還會自動關閉
: 請問有甚麼寫法可以完成嗎?
: 我知道在c裡可以用system("firefox URL")來打開網頁
: 那有辦法讓URL變成變數嗎?
用bash簡單解釋一下
CODE::
(假設檔名是 test.sh)
#!/bin/bash
firefox $1
使用方式:(example)
sh test.sh www.kimo.com
簡易說明:
bash 裡的 $1 相當於 c語言裡的 argv[1]
剩下的請自行理解
ps: 同理可知有 $2 $3......
--
: 如果說我要寫個程式用C++或是C
: 或是shell script來讓firefox打開指定網頁
: 最好還會自動關閉
: 請問有甚麼寫法可以完成嗎?
: 我知道在c裡可以用system("firefox URL")來打開網頁
: 那有辦法讓URL變成變數嗎?
用bash簡單解釋一下
CODE::
(假設檔名是 test.sh)
#!/bin/bash
firefox $1
使用方式:(example)
sh test.sh www.kimo.com
簡易說明:
bash 裡的 $1 相當於 c語言裡的 argv[1]
剩下的請自行理解
ps: 同理可知有 $2 $3......
--
All Comments