LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Hints - process (https://www.linuxquestions.org/questions/programming-9/hints-process-18576/)

myquestion 04-15-2002 03:34 PM

Hints - process
 
Hi,

I am really new to Linux, CGI. I have to write a web version for a task as this process:
1/ Enter name
2/ Search for all file with that name
3/ Zip all the found files as found.tar.gz
4/ Print out the result

I can do this in Visual C++ w/o any proplem using createprocess and winzip command. How do I do it in Linux? Any hints will be really appreciated.

Thanks

kibble 04-15-2002 06:45 PM

Well heck if you're not against using bash scripting for this it's darn easy. The web part of it, eg. the input box is up to you but the cgi is simple.

#!/bin/bash

grep -li $1 $2/*|cut -d: -f1|xargs tar -cvzf fount.tar.gz

Now this is probably not exactly how you would prefer it. But you didn't supply enough information such as how the output should be formetted and the like, But it should give you a start. To use just supply a name to search for and a directory to search in.

Problems it does have is it won't work with files with spaces in the name.

myquestion 04-15-2002 07:26 PM

Thanks a lot. I'll try it and let you know how it goes.


All times are GMT -5. The time now is 09:35 PM.