# Shell Variables

**URL:** <https://forums.thehomestack.io/t/shell-variables/258>\
**Category:** Linux - General\
**Created:** [May 27, 2007, 7:23pm UTC](https://forums.thehomestack.io/t/shell-variables/258 "2007-05-27T19:23:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://forums.thehomestack.io/uploads/default/original/1X/161426793bc0d8bdf0d1a6692b3e44446861cc72.jpeg) [@system](https://forums.thehomestack.io/u/system)\
**Post date:** [May 27, 2007, 7:23pm UTC](https://forums.thehomestack.io/t/shell-variables/258/1 "2007-05-27T19:23:49Z")

</div>

Here are some shell variables:

```auto
    $var value of var
    ${var} value of var, insulate var string
    $var[i] value of 1th word in var wordlist
    $var[li] same as $var
[/li] ${var}[i] value of 1th word in var wordlist, insulate var string
    $#var number of words in wordlist
    $i same as $argv[i] (i now restricted to 1-9!!!)
    $* same as $argv[li]
[/li] $var[n-m] words n through m from var wordlist, though n and m can
                both be absent and default to 1 and $#var resp.

    $0 name of scriptfile
    $?var 1 if var defined, 0 if not
    $$ process ID of parent shell
    $< substitute line from stdin (interactive input)

```
