Question: How Do You Increment a Date in Unix Shell Script?
Contents How Do I Increment a Date in Unix? Startdate=”$(Date -D”$1″ +%S)”; What I Need to Do Is Iterate Eight Times, Each Time Incrementing the Epoch Date by...
Contents
How do I increment a date in Unix?
startdate=”$(date -d”$1″ +%s)”; What I need to do is iterate eight times, each time incrementing the epoch date by one day and then displaying it in the format mm–dd-yyyy.
Must Read
How do I display the date in shell?
Sample shell script to display the current date and time
#!/bin/bash now=”$(date)” printf “Current date and time %sn” “$now” now=”$(date +’%d/%m/%Y’)” printf “Current date in dd/mm/yyyy format %sn” “$now” echo “Starting backup at $now, please wait…” # command to backup scripts goes here # …