bsh project

This commit is contained in:
brice.boisson
2022-02-08 18:50:03 +01:00
commit 7744ceaa33
109 changed files with 9536 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
foo()
{
echo $@
echo $#
echo $2
}
foo salut je suis un argument

View File

@@ -0,0 +1,9 @@
foo()
{
echo $@
}
foo arguments de la fonction
echo $@
foo "d'autres" arguments
exit 4

6
tests/functions/basic.sh Normal file
View File

@@ -0,0 +1,6 @@
foo()
{
echo "foo"
}
foo

View File

@@ -0,0 +1,8 @@
if true
then
foo() {
echo 'I am in foo function'
}
fi
foo

View File

@@ -0,0 +1,11 @@
foo()
{
bar()
{
echo "bar"
echo $@
}
}
foo salut je suis un argument
bar salut

View File

@@ -0,0 +1,9 @@
foo()
{
echo "this is a test"
echo $@
}
foo salut
foo
foo foo foo; foo a

View File

@@ -0,0 +1,11 @@
test()
{
if $@; then
test false
else
echo end
fi
}
test true
echo "did this work ?"

View File

@@ -0,0 +1,6 @@
fun() {
echo "fun"
}
echo fun
echo; fun

View File

@@ -0,0 +1,11 @@
a=12
fun()
{
a=42
echo "$a"
}
echo $a
fun
echo $a