![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| search by modified date | kotasateesh | Shell Programming and Scripting | 4 | 06-24-2008 06:59 AM |
| How to list files that were added or modified on a certain date? | thoughts | UNIX for Dummies Questions & Answers | 8 | 02-19-2008 09:44 PM |
| greping certain modified date | ali560045 | Shell Programming and Scripting | 2 | 02-08-2008 03:54 AM |
| Create a list of files that were modified after a given date. | rkka | UNIX for Dummies Questions & Answers | 4 | 01-22-2008 01:12 AM |
| How do I get the last modified date of a file? | akpopa | UNIX for Dummies Questions & Answers | 2 | 08-29-2001 12:08 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Last Modified Date
Hello,
I'm on a practical training and i have to change a shell script which print out a HTML-File with all Printers (and features example: IP, Mac etc.) they have in the factory. The Features of the Printers are on each separate file. i mean every printer have an own file with it features. Well, I have to change it that the script prints me the last Modified Date of the File,too. i have found the command flastmod but i'm a newbie in shell Programming here is a litte part of the script (i think it's the print out) Code:
grep Kostenstelle $PFAD$DR | awk '{printf("<TD>%s\n",$2)}' | tee -a $HTMLFILE
grep Bemerkung $PFAD$DR | awk '{printf("<TD>%s %s %s %s %s\n",$2,$3,$4,$5,$6)}' | tee -a $HTMLFILE
grep Fertigungspunkt $PFAD$DR | awk '{printf("<TD>%s\n",$2)}' | tee -a $HTMLFILE
grep Gebaeude $PFAD$DR | awk '{printf("<TD>%s %s %s %s %s\n",$2,$3,$4,$5,$6)}' | tee -a $HTMLFILE
grep Sauele $PFAD$DR | awk '{printf("<TD>%s\n",$2)}' | tee -a $HTMLFILE
grep Telefon $PFAD$DR | awk '{printf("<TD>%s\n",$2)}' | tee -a $HTMLFILE
grep Kabel-Nr $PFAD$DR | awk '{printf("<TD>%s %s %s %s %s\n",$2,$3,$4,$5,$6)}' | tee -a $HTMLFILE
grep IP-Adresse $PFAD$DR | awk '{printf("<TD>%s\n",$2)}' | tee -a $HTMLFILE
grep MAC-Adresse $PFAD$DR | awk '{printf("<TD><FONT SIZE=-1>%s</FONT>\n",$2)}' | tee -a $HTMLFILE
|
| Forum Sponsor | ||
|
|
|
|||
|
thanks
it's not working, well it is working but the date of last modified ist not working. It print's it out if it is a string Code:
awk '/Kostenstelle/ {printf("<TD>%s\n",$2)}'$PFAD$DR | tee -a $HTMLFILE
awk '/Bemerkung/ {printf("<TD>%s %s %s %s %s\n",$2,$3,$4,$5,$6)}' $PFAD$DR | tee -a $HTMLFILE
awk '/Fertigungspunkt/{printf("<TD>%s\n",$2)}' $PFAD$DR | tee -a $HTMLFILE
awk '/Gebaeude/ {printf("<TD>%s %s %s %s %s\n",$2,$3,$4,$5,$6)}' $PFAD$DR | tee -a $HTMLFILE
awk '/Sauele/ {printf("<TD>%s\n",$2)}' $PFAD$DR | tee -a $HTMLFILE
awk '/Telefon/ {printf("<TD>%s\n",$2)}' $PFAD$DR | tee -a $HTMLFILE
awk '/Kabel-Nr/ {printf("<TD>%s %s %s %s %s\n",$2,$3,$4,$5,$6)}' $PFAD$DR | tee -a $HTMLFILE
awk '/IP-Adresse/ {printf("<TD>%s\n",$2)}' $PFAD$DR | tee -a $HTMLFILE
echo 'stat -c "%y" $PFAD$DR ' | tee -a $HTMLFILE
|
|
|||
|
it doesnt work
Code:
grep Kostenstelle $PFAD$DR | awk '{printf("<TD>%s\n",$2)}' | tee -a $HTMLFILE
grep Bemerkung $PFAD$DR | awk '{printf("<TD>%s %s %s %s %s\n",$2,$3,$4,$5,$6)}' | tee -a $HTMLFILE
grep Fertigungspunkt $PFAD$DR | awk '{printf("<TD>%s\n",$2)}' | tee -a $HTMLFILE
grep Gebaeude $PFAD$DR | awk '{printf("<TD>%s %s %s %s %s\n",$2,$3,$4,$5,$6)}' | tee -a $HTMLFILE
grep Sauele $PFAD$DR | awk '{printf("<TD>%s\n",$2)}' | tee -a $HTMLFILE
grep Telefon $PFAD$DR | awk '{printf("<TD>%s\n",$2)}' | tee -a $HTMLFILE
grep Kabel-Nr $PFAD$DR | awk '{printf("<TD>%s %s %s %s %s\n",$2,$3,$4,$5,$6)}' | tee -a $HTMLFILE
grep IP-Adresse $PFAD$DR | awk '{printf("<TD>%s\n",$2)}' | tee -a $HTMLFILE
stat -c "%y" $PFAD$DR | awk '{printf("<TD>%s\n",$0)}' | tee -a $HTMLFILE
|
|
|||
|
yeah that's the problem
i have no error message it print's me the table with the data out. here is a screeshot http://img156.echo.cx/my.php?image=screen4cf.jpg |
|||
| Google The UNIX and Linux Forums |