CS155: Introduction to Unix

Spring 2018

Environment

See this page as a slide show

Environment variables

CS155 Environment

Introduction to Shells

Environment Variables

% date
Sun Sep 23 09:50:00 MDT 2018

% export TZ=America/Chicago
% date
Sun Sep 23 10:50:00 CDT 2018

% export TZ=Asia/Dubai
% date
Sun Sep 23 19:50:00 +04 2018

% export TZ=Europe/Paris
% date
Sun Sep 23 17:50:00 CEST 2018

% export LANG=fr_FR.UTF-8
% date
dim. sept. 23 17:50:00 CEST 2018

Environment Variables

% env
USER=applin
PATH=/bin:/usr/bin:/usr/bin/X11:.
HOME=/s/parsons/d/fac/applin
PWD=/s/parsons/d/fac/applin/tmp
GROUP=fac
HOST=blackthorn
LANG=en_US.UTF-8
HOSTNAME=blackthorn
PAGER=less
TZ=America/Denver

Environment Variables

% echo 'I am $USER on $HOSTNAME'
I am $USER on $HOSTNAME
% echo "I am $USER on $HOSTNAME"
I am cs155 on parsons
% echo I am $USER on $HOSTNAME
I am cs155 on parsons
% echo I am \$USER on \$HOSTNAME
I am $USER on $HOSTNAME
% echo $HOSTNAME
parsons
% echo $HOSTNAME | wc
      1       1       8
% cat $HOSTNAME
cat: parsons: No such file or directory

Setting environment variables

User: Guest

Check: HTML CSS
Edit History Source

Modified: 2018-02-06T12:42

Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2018 Colorado State University
CS Building