Problem You might need to get a timestamp of yesterday in any script. Analysis Do not think about any scripting and converting dates. Just use the old good ‘date’ command. Solution This script should be self explanatory: #!/bin/bash set -o
Problems receiving mails to server with Greylisting from server using Sender Address Verification
Problem When you implement greylisting on your mailserver you can have a problem to send e-mails to other mail servers which implement Sender Address Verification (SAV). You will see logs such as: Mar 17 14:17:49 ns2 postfix/smtp[6304]: 45D49241802: to=<dest@address.com>, relay=receiver.server.com[X.Y.Z.Q]:25,
Some ‘bash’ Magic
Proces the content of /etc/passwd file field by field Here IFS sets the “internal field delimiter” to “:”, but only inside the while loop. You must NOT reset it to the original value. while IFS=: read name passwd uid gid
‘grep’ Command Examples
Greping beginning of line: $ cat file | grep ‘^text’ x
‘date’ Command Examples
The date and time of the server. $ date Tue Mar 17 18:13:30 CET 2009 Set the date to the date and time shown: $ date -s “11/20/2008 12:48:00” List the time and date in the below format: $ date