Previous day date in unix shell script

Blue42

I want to a declare a variable called val1 holding the date of the previous day in yyyymmdd format

Any help would be great

Eric Fournie
val1=$(date +%Y%m%d --date="yesterday")

should do the trick.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

unix shell script to get nth business day

From Dev

UNIX Shell Script Backup Directory on Specific day

From Dev

unix shell script to get nth business day

From Dev

How to fetch Data of Previous date in shell script?

From Dev

How to find day difference between a date with `YYYY-MM-DD` format and today's date in Unix shell script?

From Dev

Unix shell script to populate date from file as first column in the file

From Dev

Checking for a file of current date in remote server through unix shell script

From Dev

How do I add time to a date in unix shell script?

From Dev

Printing day for a given date in c using shell script.

From Dev

Arithmetic in Unix shell Script

From Dev

Unix Shell Script

From Dev

Shell Script - Unix

From Dev

Shell script, linux, unix, shell

From Dev

Unix Shell Script: While loop

From Dev

Unix shell script - purpose of colon

From Dev

Beginner Unix shell script issues

From Dev

unix shell script to check for EOF

From Dev

Beginner Unix shell script issues

From Dev

missing `]' error in unix shell script

From Dev

Nested expression in a UNIX shell script

From Dev

Remove by date in Shell Script

From Dev

shell script delete on date

From Dev

Shell script date

From Dev

Need to pass the user input (date) into DB2 query in Unix shell script

From Dev

Run Perl Script From Unix Shell Script

From Dev

How to check if date is at least previous day?

From Dev

How to check if date is at least previous day?

From Dev

How to check if date is at least previous day?

From Dev

how to get previous day date using boost?