如何寫針對檔案類型的script - Linux
By Brianna
at 2010-08-22T19:24
at 2010-08-22T19:24
Table of Contents
※ 引述《tsungjen ()》之銘言:
: 比如說現在目錄下有兩種檔案
: .doc .xls
: 我想針對全部的.xls作修改
: 比如說我想移動全部的.xls到另外一個目錄下面
: 要如何寫出一個script移動所有的.xls
: 'mv *.xls* ~/XXX'
: 我不太會寫程式
: 不知道要怎麼定義= =
依照你的要求
直接把 command(s) 加到 script 裡就可以了
(記得 chmod +x 才可以執行)
不過 bash shell script 還有很多其他的功能
有興趣的話 可以 google找一下 tutorial
第1行指定 interpreter: (assume bash)
------------------------------
#!/bin/bash
mv *.xls ~/XXX
rm *.doc
--
: 比如說現在目錄下有兩種檔案
: .doc .xls
: 我想針對全部的.xls作修改
: 比如說我想移動全部的.xls到另外一個目錄下面
: 要如何寫出一個script移動所有的.xls
: 'mv *.xls* ~/XXX'
: 我不太會寫程式
: 不知道要怎麼定義= =
依照你的要求
直接把 command(s) 加到 script 裡就可以了
(記得 chmod +x 才可以執行)
不過 bash shell script 還有很多其他的功能
有興趣的話 可以 google找一下 tutorial
第1行指定 interpreter: (assume bash)
------------------------------
#!/bin/bash
mv *.xls ~/XXX
rm *.doc
--
Tags:
Linux
All Comments
By Hamiltion
at 2010-08-27T08:35
at 2010-08-27T08:35
By Carol
at 2010-09-01T03:49
at 2010-09-01T03:49
By Rosalind
at 2010-09-03T14:12
at 2010-09-03T14:12
By Edward Lewis
at 2010-09-07T09:29
at 2010-09-07T09:29
By Charlie
at 2010-09-09T04:47
at 2010-09-09T04:47
By Callum
at 2010-09-14T02:07
at 2010-09-14T02:07
By Skylar Davis
at 2010-09-17T21:59
at 2010-09-17T21:59
By Carolina Franco
at 2010-09-21T20:24
at 2010-09-21T20:24
Related Posts
如何寫針對檔案類型的script
By Ethan
at 2010-08-22T19:19
at 2010-08-22T19:19
ubuntu終端機內指令切換一問
By Isabella
at 2010-08-22T17:20
at 2010-08-22T17:20
V4L2抓取webcam的方式
By Ula
at 2010-08-22T16:27
at 2010-08-22T16:27
ubuntu10.04 + ies4linux 瀏覽登山補給站
By Susan
at 2010-08-22T13:18
at 2010-08-22T13:18
網聚芻議
By Odelette
at 2010-08-22T02:53
at 2010-08-22T02:53