Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Subject: Unix scripting question

Original Message
Name: vande
Date: April 9, 2008 at 07:46:58 Pacific
Subject: Unix scripting question
OS: Unix
CPU/Ram: idk :)
Model/Manufacturer: :)?
Comment:
ok so im gonna paste some code can some one explain one thing to me. And that is where fld1 ,2 ,3 filemonth fld 5 etc come from its reading these folder/ files but...........
# File cleanup
if [ -e ftemp1$$ ]
then
cat ftemp1$$ |
while read fld1 fld2 fld3 filemonth fld5 fileyear filename fld99
do
echo "$filemonth$fileyear $filename" |
grep -v ${month[0]} | grep -v ${month[1]} |
grep -v ${month[2]} | grep -v ${month[3]} |
grep -v ${month[4]} | grep -v ${month[5]} |
grep -v ${month[6]} | grep -v ${month[7]} |
grep -v ${month[8]} | grep -v ${month[9]} |
grep -v ${month[10]}| grep -v ${month[11]} |
grep -v ${month[12]} >> ftemp2$$
done

cat ftemp2$$ |
while read fld1 filename
do
rm 2>/dev/null $filename
ls -l 2>/dev/null $filename >> $outfile
done
fi


there is more to the code and ftemp1$$ exist
everything works im just trying to understand a part of this code ...... and there is no where else where these folders/files its reading are created nor are they in the directory this script is ran from they dont exist how can you read on something that isn't there? well miswell not say that cause the script works so they must be logically created some how

Learning in progress..........


Report Offensive Message For Removal

Response Number 1
Name: ghostdog
Date: April 9, 2008 at 17:03:45 Pacific
Subject: Unix scripting question
Reply: (edit)
this is a rather messy script. you don't need that many greps and useless cats. Just tell what are you trying to do and show by examples.

Report Offensive Follow Up For Removal

Response Number 2
Name: vande
Date: April 9, 2008 at 17:27:01 Pacific
Subject: Unix scripting question
Reply: (edit)
Well that is one portion of the script if i gave you whole thing this grepping makes sense

Learning in progress..........


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Unix scripting question

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software



Version Tracker Pro
Keep your software current and secure, effortlessly

Click Here for a Free Scan

Driver Agent
Automatically find the latest drivers for your computer.
Click Here for a Free Scan



The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC