diff --git a/bash/train_bash/function.sh b/bash/train_bash/function.sh index 7a997f3..089ca3c 100755 --- a/bash/train_bash/function.sh +++ b/bash/train_bash/function.sh @@ -1,12 +1,17 @@ #!/bin/bash -foo="help" - -internakCall() { - local foo='error' - echo 'Вызов HTTP сервера GET' - return 10 +outer() { + local count=0 + inner() { + count=$(($count + 1)) + echo $count + } } -res=`internakCall` -echo $? +outer +outer +outer +outer + +# res=outer +# count=$(res) diff --git a/bash/train_bash/rest.sh b/bash/train_bash/rest.sh new file mode 100755 index 0000000..c3a48c1 --- /dev/null +++ b/bash/train_bash/rest.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +while true; do { + echo -ne "HTTP/1.0 200 OK\r\n + Content-Length: \$(wc -c