Home › DevOps › AutoSys envvars and profile: Set Environment Variables for a Job in JIL
Intermediate 3 min · November 09, 2026

AutoSys envvars and profile: Set Environment Variables for a Job in JIL

An AutoSys job doesn't inherit your shell's variables.

N
Naren Founder & Principal Engineer

20+ years shipping production infrastructure and CI/CD at scale. Lessons pulled from things that broke in production.

Follow
✓ Production
production tested
November 09, 2026
last updated
2,128
articles · all by Naren
Before you start⏱ 6 min
  • ✓AutoSys JIL basics
 ● Production Incident 🔎 Debug Guide
⚡Quick Answer
  • Jobs don't load your login shell's ~/.bashrc.
  • envvars: NAME=value, one line per variable (repeat the attribute).
  • profile: /path/file.env runs a file of exports first.
  • Quote values with spaces: envvars: LABEL="month end".
  • Quote or escape colons: envvars: DB_URL="db01:1521/FIN".
  • In scripts, fail on missing values: ${VAR:?VAR not set}.
✦ Definition~90s read
What is AutoSys envvars and profile?

An AutoSys job starts without your interactive shell setup, so variables exported in ~/.bashrc aren't there. The envvars attribute sets environment variables for the job, one variable per line; the profile attribute names a file of exports that runs before the command.

★
Your terminal is a desk with sticky notes everywhere.
Plain-English First

Your terminal is a desk with sticky notes everywhere. The job gets a clean desk. envvars hands it the notes it needs, one at a time; profile hands it the whole notebook.

A script that reads $BUS_DATE works in your terminal and writes to the wrong folder in AutoSys, because the job never had the variable. This guide shows how to give it one.

Why the Job Doesn't See It

The job runs a command through the agent, not your login shell, so files like ~/.bashrc aren't read.

debug.shBASH
1
2
# temporary: see the job's environment
env | sort > /tmp/job_env.txt
🎯 Key Takeaway
Pass everything the script needs.

envvars

One envvars line per variable. Use as many as you need.

envvars.jilJIL
1
2
3
update_job: FIN_EXTRACT
envvars: BUS_DATE=2026-11-09
envvars: OUT_DIR=/data/out
🎯 Key Takeaway
envvars: NAME=value.

profile

profile points to a file of exports that runs before the command. Good for a shared set of variables.

profile.jilJIL
1
2
update_job: FIN_EXTRACT
profile: /apps/fin/fin.env
🎯 Key Takeaway
profile for a whole set.

Quoting

Values with spaces need quotes. JIL splits on colons, so quote or escape values that contain them.

quoting.jilJIL
1
2
envvars: RUN_LABEL="month end"
envvars: DB_URL="db01:1521/FIN"
🎯 Key Takeaway
Quote spaces and colons.

Fail on Empty

A missing variable should stop the job, not produce wrong output.

extract.shBASH
1
2
: "${BUS_DATE:?BUS_DATE not set}"
out="$OUT_DIR/$BUS_DATE.csv"
🎯 Key Takeaway
${VAR:?msg}.
● Production incidentPOST-MORTEMseverity: high

The Extract That Lost Its Date

Symptom
Files named .csv with no date; downstream loads picked up nothing.
Assumption
BUS_DATE was set, because it was set in the developer's terminal.
Root cause
BUS_DATE was exported in the developer's ~/.bashrc, which the job doesn't load.
Fix
Added envvars to the job and made the script stop when BUS_DATE is empty.
Key lesson
  • Jobs don't inherit your shell.
  • Set variables in the job definition.
  • Fail on empty required variables.
Production debug guideWhat does the job really see?2 entries
Symptom · 01
Variable empty in the job
→
Fix
Add env > /tmp/env_$$.txt to the script temporarily and compare with your terminal.
Symptom · 02
JIL error on the envvars line
→
Fix
Quote values with spaces or colons.
⚙ Quick Reference
5 commands from this guide
FileCommand / CodePurpose
debug.shenv | sort > /tmp/job_env.txtWhy the Job Doesn't See It
envvars.jilupdate_job: FIN_EXTRACTenvvars
profile.jilupdate_job: FIN_EXTRACTprofile
quoting.jilenvvars: RUN_LABEL="month end"Quoting
extract.sh: "${BUS_DATE:?BUS_DATE not set}"Fail on Empty

Key takeaways

1
Jobs don't inherit your shell.
2
envvars for single variables.
3
profile for a file of exports.
4
Quote spaces and colons.
5
Fail on empty values.

Common mistakes to avoid

2 patterns
×

Relying on ~/.bashrc

Symptom
Empty variables in the job.
Fix
envvars or profile.
×

Unquoted colon

Symptom
JIL parse error.
Fix
Quote the value.
INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01JUNIOR
How do you set environment variables for an AutoSys job?
Q01 of 01JUNIOR

How do you set environment variables for an AutoSys job?

ANSWER
envvars attribute (one per line) or a profile file.
FAQ · 2 QUESTIONS

Frequently Asked Questions

01
How do I add an environment variable in an AutoSys JIL file?
02
How do I pass a business date to an AutoSys job?
COMPLETE GUIDE
The Complete AutoSys Workload Automation Guide for Engineers →

JIL syntax, sendevent, autorep, box jobs, file watchers, scheduling, HA, security, cloud workload automation, and 22 interview questions — the definitive AutoSys reference for production engineers.

N
Naren Founder & Principal Engineer

20+ years shipping production infrastructure and CI/CD at scale. Lessons pulled from things that broke in production.

Follow
✓ Verified
production tested
November 09, 2026
last updated
2,128
articles · all by Naren
🔥

That's AutoSys. Mark it forged?

3 min read · try the examples if you haven't

←
Previous
AutoSys Resources: One Job at a Time
47 / 49 · AutoSys
Next
Rename an AutoSys Job (rename_job)
→