Jump to content

Bash script in workflow. Language of locals ? Accented characters ?


Recommended Posts

Hi all,


I've have some problems with determining the locals language in bash script in workflows in Alfred2.

I'm on OSX 10.7.5 FR.


My script : 

DATE=$(echo "{query}" | sed -e's/HAEC/CEST/g' -e's/HNEC/CET/g'); export LC_TIME="fr_FR.UTF-8"; date -jf "%d %B %Y %T %Z" "$DATE" "+%Y%m%d%H%M%S"


I use it :

Select a text date (i.e. : "18 décembre 2006 19:24:12 HNEC"), use my hotkey to launch Alfred2/Workflow/Bashscript


Problem :


• In Alfred2 when month has NO accented character (i.e. : "18 janvier 2006 19:24:12 HNEC")

• In terminal as is with or without month with accented characters


Does NOT work

• In Alfred2 when month has accented character


Note :

I had to add 'export LC_TIME="fr_FR.UTF-8"' as I assume Alfred bash script works in EN. It didn't work with french dates even though my whole system is in french and it DOES work in terminal without the export command. Also, I had to "translate" HAEC and HNEC as date command doesn't understand this frenchified CEST and CET.


Any ideas on how I can bypass this problem ? Is it a bug ?


Thanks in advance !



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...