Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Batch Script for gzip/ack
Name: some_sec_guy Date: June 29, 2009 at 12:04:23 Pacific OS: Windows 2003 Subcategory: Batch
Comment:
There's a problem I'm having trying to automate the process of grepping proxy files. Currently my string looks like this.
@echo off set /P %%G=Please Enter Date to Grep e.g. "*mmdd*": gzip.exe -v -c -d d:\logs\%%G.gz | perl ack.pl -i -h "phrase_to_grep" > "logs/%date%_filename.txt"
I'm trying to figure out a way to prompt the user for what files they want to search for based on date. As you can see I attempted to use %%G for my variable after it's set. Although, it doesn't recognize it because it's being used in the dir path.
Name: tonysathre Date: June 29, 2009 at 12:31:35 Pacific
Reply:
You are using the variables wrong.
Untested
@echo off
set /P var=Please Enter Date to Grep e.g. "*mmdd*":
gzip.exe -v -c -d d:\logs\%var%.gz | perl ack.pl -i -h "phrase_to_grep" > "logs/%date%_filename.txt"
Summary: I am working on a batch script that would update 7 different file servers that run the exact same application. The servers have identical directory structures. My goal is to create a mirrored direct...
Summary: I have a FOR loop in a Batch Script on XP Pro. FOR /L %%A IN (1 1 %engine_instance%) DO ( type %logs_dir%\sim_engine_%%A.log | FIND "Customers Processed This Run" > %logs_dir%\run_sim_temp_%%A.txt ...
Summary: hi, so 'im trying to run a batch script. its not supposed to be very difficult. i run an encoding machine for audio at the company i work at. it is run by a basic dos command line. you put in the...