LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-15-2002, 04:34 PM   #1
myquestion
LQ Newbie
 
Registered: Feb 2002
Posts: 4

Rep: Reputation: 0
Question 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
 
Old 04-15-2002, 07:45 PM   #2
kibble
LQ Newbie
 
Registered: Apr 2002
Posts: 14

Rep: Reputation: 0
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.
 
Old 04-15-2002, 08:26 PM   #3
myquestion
LQ Newbie
 
Registered: Feb 2002
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks a lot. I'll try it and let you know how it goes.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tricks and hints neo77777 Linux - General 145 08-24-2009 03:38 AM
Wargame Hints? the_p0et Linux - Security 3 10-20-2003 12:04 AM
hints and tips bigjohn LQ Suggestions & Feedback 0 08-04-2003 02:48 PM
Slackware CUPS hints mi6 Slackware 3 06-05-2003 09:56 PM
gcad hints ? jamaso Linux - General 0 03-02-2002 09:27 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration