Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 53668

Summary: Problem when displaying date in a function
Product: [Retired] Red Hat Linux Reporter: maixent.vothanh
Component: bashAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED NOTABUG QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-09-14 13:39:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description maixent.vothanh 2001-09-14 13:39:29 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.75 [fr] (X11; U; Linux 2.2.16-22 i686)

Description of problem:
Used in a crontab date seemed to behave in different ways. I'm using this :
jour=`date | awk '{print $1}'`
echo "hello" > "$jour"_example.txt
I'm waiting french types like lun, mar, mer,...etc. For instance :
ven_example.txt
This is rolling OK when I'm launching my script directly, but when I'm
lauching it by the crontab I'm getting Fri_example.txt for instance.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. make a simple script with th lines described before
2. launch it manually
3.Compare the result launching the script with crontab
	

Actual Results:  1. Manually the result is a file named ven_example.txt
2. With the crontab, its a file named Fri_example.txt

Expected Results:  The same result I obtain manually than with the crontab

Additional info:

I'm using French environment

Comment 1 Bernhard Rosenkraenzer 2001-09-18 09:08:44 UTC
This is because cron does not set the LANG environment variable.
Add

source /etc/sysconfig/i18n

to your script, or add LANG=fr_FR to /etc/crontab.