Difference between revisions of "BASH"
Jump to navigation
Jump to search
Rafahsolis (talk | contribs) |
Rafahsolis (talk | contribs) |
||
| Line 8: | Line 8: | ||
=== Variables === | === Variables === | ||
| + | ==== Local Variables ==== | ||
| + | <source lang="bash"> | ||
| + | #!/bin/bash | ||
| + | HELLO=Hello | ||
| + | function hello { | ||
| + | local HELLO=World | ||
| + | echo $HELLO | ||
| + | } | ||
| + | echo $HELLO | ||
| + | hello | ||
| + | echo $HELLO | ||
| + | </source> | ||
| + | |||
=== Strings === | === Strings === | ||
=== Loops === | === Loops === | ||
Revision as of 00:51, 27 March 2015
BASH Script
Hello World
#!/bin/bash
STR="Hello World"
echo $STR
Variables
Local Variables
#!/bin/bash
HELLO=Hello
function hello {
local HELLO=World
echo $HELLO
}
echo $HELLO
hello
echo $HELLO