This is a discussion on Need this script within the Shell scripting forums, part of the Development/Scripting category; Hi guys. I am a linux beginner and I have no idea how to do this so any help would ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
Hi guys. I am a linux beginner and I have no idea how to do this so any help would be much appreciated. I need a script that would copy complete content of some files, lets say file1.txt to a html file. But I need it to paste text between <pre> and </pre> in html file. I am not too laisy to do this manually , but this should be done every day so I was hoping to automate the process.
P.S. I know it is not the right place, but if someone knows if this is possible on windows with batch file that would aslo be great. Thanks in advance. |
| Sponsored Links | ||
|
|
|
|||
|
Quote:
@Tom, thx for that. I'll have to ask my friend to try it out. And another thing guys, how do I schedule a script to run like at 1:00 AM every day. And since this is only a part of the process I would like to run if you could tell me how do I get it to wait until process is finished before running a next command. I need this tool to grab some files from the net, then it has command to convert them to txt. Then copy result to template.html file in between pre tags. And ftp html files to server. So I would need it to wait until grabbing is finished before running a convert command. I think I alreday found a script on this forum that handles uploading files on server. So I would like to know what should be entered in a script after command that grabs the file from net to make it wait before it converts the file. First process takes like 10 minutes, but it varies. |
|
|||
|
You need to use cygwin tool. It is a windows ports of many of the popular GNU software tools, including the BASH, grep, awk and so on.
http://www.cygwin.com/ There are few other ways to install Linux under Windows XP including Free and commercial tools, just have a look at following url How do I use Linux on windows XP/2000 system? http://www.cyberciti.biz/faqs/2006/0...ows-xp2000.php If you have remote Linux box, no need to install linux on Windows XP, you can run all scripts on remote linux box: http://www.cyberciti.biz/faqs/2006/0...-xp-system.php Quote:
To run script called foo.sh 1AM everyday: Code:
0 1 * * * /path/to/foo.sh Code:
#!/bin/sh # code to grab files # end # call bar.sh to copy and paste stuff . /path/to/bar.sh |
|
|||
|
Thx for that info, but when I mentioned windows I didn't mean I would like to use this script on windows, I tought it would be good if such operation could be preformed using cmd.exe on xp with commands grouped into a .bat file.
But I guess I could try with cygwin. |
|
|||
|
Quote:
|
|
|||
|
Hmm
It is working here and I'm using Debian Linux. Code:
cat file1.txt This is a test This is a test <pre>Code Some more code </pre> Ok this is a test done save Code:
awk "/<pre>/,/<\/pre>/" file1.txt > out.html Code:
cat out.html Some more code </pre> |