/opt/local/var/macports/build/augeas-9bb98f7d/work/augeas-1.12.0/lenses/tests/test_shellvars.aug - Augeas Documentation

# test_shellvars.aug

Summary

test_shellvars.aug |
Shellvars.lns | Support `##` bashism in conditions (GH issue #118)
Shellvars.lns | Parse (almost) any command
Shellvars.lns | Support pipes in commands
Shellvars.lns | Support && and || after command GH #215
Unsupported syntax | The following tests are known to be failing currently

### Shellvars.lns

> test Shellvars.lns get "if [ \"${APACHE_CONFDIR##/etc/apache2-}\" != \"${APACHE_CONFDIR}\" ] ; then SUFFIX=\"-${APACHE_CONFDIR##/etc/apache2-}\" else SUFFIX= fi\n" = { "@if" = "[ \"${APACHE_CONFDIR##/etc/apache2-}\" != \"${APACHE_CONFDIR}\" ]" { "SUFFIX" = "\"-${APACHE_CONFDIR##/etc/apache2-}\"" } { "@else" { "SUFFIX" = "" } } }

Support `##` bashism in conditions (GH issue #118)

### Shellvars.lns

> test Shellvars.lns get "echo foobar 'and this is baz' /usr/local/bin/myscript-with-dash_and_underscore.sh with args echo foo \ bar\n" = { "@command" = "echo" { "@arg" = "foobar 'and this is baz'" } } { "@command" = "/usr/local/bin/myscript-with-dash_and_underscore.sh" { "@arg" = "with args" } } { "@command" = "echo" { "@arg" = "foo \\\nbar" } }

Parse (almost) any command

### Shellvars.lns

> test Shellvars.lns get "echo \"$STRING\" | grep foo\n" = { "@command" = "echo" { "@arg" = "\"$STRING\"" } { "@pipe" { "@command" = "grep" { "@arg" = "foo" } } } }

Support pipes in commands

### Shellvars.lns

> test Shellvars.lns get "grep -q \"Debian\" /etc/issue && echo moo\n" = { "@command" = "grep" { "@arg" = "-q \"Debian\" /etc/issue" } { "@and" { "@command" = "echo" { "@arg" = "moo" } } } }

Support && and || after command GH #215

### Unsupported syntax

The following tests are known to be failing currently

> test Shellvars.lns get "if [ \"${APACHE_CONFDIR##/etc/apache2-}\" != \"${APACHE_CONFDIR}\" ] ; then SUFFIX=\"-${APACHE_CONFDIR##/etc/apache2-}\" else SUFFIX= fi\n" = { "@if" = "[ \"${APACHE_CONFDIR##/etc/apache2-}\" != \"${APACHE_CONFDIR}\" ]" { "SUFFIX" = "\"-${APACHE_CONFDIR##/etc/apache2-}\"" } { "@else" { "SUFFIX" = "" } } }

Support `##` bashism in conditions (GH issue #118)
Close