From 773f8d990aaf32bf71d5de93c26273e7abffe8fb Mon Sep 17 00:00:00 2001 From: Vitaliy Turov Date: Wed, 27 Nov 2024 20:44:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D1=80=D0=B5=D0=BD=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=B0=20=D0=BD=D0=B0=20=D0=BF=D0=B0=D1=80=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/train_bash/function.sh | 21 +++++++++++++-------- bash/train_bash/rest.sh | 7 +++++++ 2 files changed, 20 insertions(+), 8 deletions(-) create mode 100755 bash/train_bash/rest.sh 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