由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - [转载] 再请教高手
相关主题
[转载] 请教高手How to use file modifiers in bash/sh
a puzzle!![转载] using ssh in tcsh script
[转载] qestion about grepft, 本版备忘录
[转载] Help!How to set directory for #include <**.h>script language that runs on multiple platiform
which shell is best?提示我 too many ('s 怎么办?
请教个scripts的问题请推荐一本Unix的最全面的书籍阿
我的alia放在script里为什么不工作?怎么从script中把环境变量传回到当前shell中? (转载)
够执着的 --- Re: 我的alia放在script里为什么不工作?how to write a recursive fcn using ksh to find all the occurances of a file?
相关话题的讨论汇总
话题: file话题: program话题: directory话题: my话题: 高手
进入Unix版参与讨论
1 (共1页)
i**********r
发帖数: 36
1
【 以下文字转载自 Linux 讨论区 】
【 原文由 interstellar 所发表 】
I have a directory for certain purpose. Whenever i save a file
to that directory, I need to run a program upon the saved file.
My question is, Can the saving-file event intrigue the invocation
of my program AUTOMATICALLY? If can, how?
thanks!!!
y***y
发帖数: 54
2
should be in your "saving" action bah, I don't think the system
can do anything.
are you manually saving or via some program?

【在 i**********r 的大作中提到】
: 【 以下文字转载自 Linux 讨论区 】
: 【 原文由 interstellar 所发表 】
: I have a directory for certain purpose. Whenever i save a file
: to that directory, I need to run a program upon the saved file.
: My question is, Can the saving-file event intrigue the invocation
: of my program AUTOMATICALLY? If can, how?
: thanks!!!

G**T
发帖数: 388
3

after the file saved, then trigue another program?
if so, one simple way:
1) check the file's size, if it changes, then
run ur program
else do nothing
2) go to 1. :)
like ur mail notifier

【在 i**********r 的大作中提到】
: 【 以下文字转载自 Linux 讨论区 】
: 【 原文由 interstellar 所发表 】
: I have a directory for certain purpose. Whenever i save a file
: to that directory, I need to run a program upon the saved file.
: My question is, Can the saving-file event intrigue the invocation
: of my program AUTOMATICALLY? If can, how?
: thanks!!!

i**********r
发帖数: 36
4
What I want to do is like this:
1)I go to www.spaceflightnow.com
2)I download the daily news with the default name index.html
into that directory, using "save as"
Since this page has a very unsatisfying appearance, I wrote a perl
program to extract the text body from index.html to rearrange into
a new html file.
3)go to an xterm, to run the perl program.
Now I want the system to do the third step, so that I don't need to
shift to another window and type in the command---you know, sometim

【在 y***y 的大作中提到】
: should be in your "saving" action bah, I don't think the system
: can do anything.
: are you manually saving or via some program?

D****N
发帖数: 430
5
Write a bash script to do everything ah...
wget http://www.spaceflightnow.com/index.html
my_perl_hack index.html
mv index.html `date +%m-%d`.html

【在 i**********r 的大作中提到】
: What I want to do is like this:
: 1)I go to www.spaceflightnow.com
: 2)I download the daily news with the default name index.html
: into that directory, using "save as"
: Since this page has a very unsatisfying appearance, I wrote a perl
: program to extract the text body from index.html to rearrange into
: a new html file.
: 3)go to an xterm, to run the perl program.
: Now I want the system to do the third step, so that I don't need to
: shift to another window and type in the command---you know, sometim

i**********r
发帖数: 36
6
Thanks,
but my situation is a little bit different. I need to surf
the web before I decide which news to download. When I click on
the link to that news, the address showed is not index.html,
but another unpredictable name. When I try to save-as, the
default name appearing in the dialogue box is index.html

【在 D****N 的大作中提到】
: Write a bash script to do everything ah...
: wget http://www.spaceflightnow.com/index.html
: my_perl_hack index.html
: mv index.html `date +%m-%d`.html

i*******n
发帖数: 166
7
run this script in your directory
#!/bin/tcsh -f
while(1)
if ( -e index.html) then
your_perl_script index.html
mv -f index.html `date +%d%m_%H%M`.html
else
sleep 60
endif
end

【在 i**********r 的大作中提到】
: Thanks,
: but my situation is a little bit different. I need to surf
: the web before I decide which news to download. When I click on
: the link to that news, the address showed is not index.html,
: but another unpredictable name. When I try to save-as, the
: default name appearing in the dialogue box is index.html

i**********r
发帖数: 36
8
do you have any concept about the CPU burden
caused by such a script?
I would rather to use crontab,

【在 i*******n 的大作中提到】
: run this script in your directory
: #!/bin/tcsh -f
: while(1)
: if ( -e index.html) then
: your_perl_script index.html
: mv -f index.html `date +%d%m_%H%M`.html
: else
: sleep 60
: endif
: end

i*******n
发帖数: 166
9

Yes, I have. The answer is: trivial.
Just like that you feel nothing when you invoke xbiff etc.
Please make an investigation about the CPU burden yourself.
Well, you can use whatever you want.

【在 i**********r 的大作中提到】
: do you have any concept about the CPU burden
: caused by such a script?
: I would rather to use crontab,

i**********r
发帖数: 36
10
Go to tomb, give me a buzz.

【在 i*******n 的大作中提到】
:
: Yes, I have. The answer is: trivial.
: Just like that you feel nothing when you invoke xbiff etc.
: Please make an investigation about the CPU burden yourself.
: Well, you can use whatever you want.

1 (共1页)
进入Unix版参与讨论
相关主题
how to write a recursive fcn using ksh to find all the occurances of a file?which shell is best?
Korn shell script请教个scripts的问题
script问题----运行多个文件我的alia放在script里为什么不工作?
Shell Script: about soft link够执着的 --- Re: 我的alia放在script里为什么不工作?
[转载] 请教高手How to use file modifiers in bash/sh
a puzzle!![转载] using ssh in tcsh script
[转载] qestion about grepft, 本版备忘录
[转载] Help!How to set directory for #include <**.h>script language that runs on multiple platiform
相关话题的讨论汇总
话题: file话题: program话题: directory话题: my话题: 高手