From 4d395088d0f44674854f5b50035eefcc324a578b Mon Sep 17 00:00:00 2001 From: Eric LAZO Date: Fri, 12 Aug 2022 20:08:49 +0200 Subject: [PATCH 1/8] trying to get submit form to work... --- srcs/Client.cpp | 5 ++--- srcs/config/parser.cpp | 4 ++-- srcs/webserv/request.cpp | 2 ++ srcs/webserv/response.cpp | 6 +++--- www/test/submit_form.html | 15 +++++++++++++++ 5 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 www/test/submit_form.html diff --git a/srcs/Client.cpp b/srcs/Client.cpp index f064337..5b2e8a5 100644 --- a/srcs/Client.cpp +++ b/srcs/Client.cpp @@ -92,7 +92,7 @@ void Client::parse_request_headers(std::vector &servers) _parse_request_fields(); // DEBUG -print_client("headers"); +//print_client("headers"); if (status) return; @@ -263,8 +263,7 @@ void Client::clear_script() void Client::print_client(std::string message) { std::map::iterator it; - - std::cout << "\n=== DEBUG PRINT CLIENT ===\n"; +std::cout << "\n=== DEBUG PRINT CLIENT ===\n"; std::cout << message << ":\n----------\n\n" << "raw_request:\n__\n"; ::print_special(raw_request); std::cout << "\n__\n" diff --git a/srcs/config/parser.cpp b/srcs/config/parser.cpp index 9dc09f4..dd33ed7 100644 --- a/srcs/config/parser.cpp +++ b/srcs/config/parser.cpp @@ -194,7 +194,7 @@ void ConfigParser::_set_server_values(ServerConfig *server, \ { if (tmp_val[0].find_first_of(":") == NPOS) { - if (!::isNumeric(tmp_val[0])) + if (!::isNumeric_btw(0, 65535, tmp_val[0])) throw std::invalid_argument("bad port number"); server->host = "0.0.0.0"; server->port = tmp_val[0]; @@ -211,7 +211,7 @@ void ConfigParser::_set_server_values(ServerConfig *server, \ if (!::isNumeric_btw(0, 255, ip[i])) throw std::invalid_argument("bad host ip"); } - if (!::isNumeric(tmp2[1])) + if (!::isNumeric_btw(0, 65535, tmp2[1])) throw std::invalid_argument("bad port number"); server->host = tmp2[0]; server->port = tmp2[1]; diff --git a/srcs/webserv/request.cpp b/srcs/webserv/request.cpp index 0799aa7..8b159f3 100644 --- a/srcs/webserv/request.cpp +++ b/srcs/webserv/request.cpp @@ -52,6 +52,8 @@ int Webserv::_read_request(Client *client) } client->raw_request.append(buf, ret); + print_special(client->raw_request); + if (!client->header_complete) { client->parse_request_headers(_servers); diff --git a/srcs/webserv/response.cpp b/srcs/webserv/response.cpp index 436e478..ddda809 100644 --- a/srcs/webserv/response.cpp +++ b/srcs/webserv/response.cpp @@ -199,17 +199,17 @@ If we get a url that ends in / ignore the last / */ std::string uri = path; - if (uri[uri.size() - 1] == '/') + if (uri[uri.size() - 1] == '/' && uri.size() != 1) uri.erase(uri.size() - 1); for (std::vector::const_iterator it = server.locations.begin(); it != server.locations.end(); it++) { - std::cout << it->path << " -- "; +// std::cout << it->path << " -- "; if (it->path.size() > uri.size()) { - std::cout << "skipping this one\n"; +// std::cout << "skipping this one\n"; continue ; } diff --git a/www/test/submit_form.html b/www/test/submit_form.html new file mode 100644 index 0000000..0688854 --- /dev/null +++ b/www/test/submit_form.html @@ -0,0 +1,15 @@ + + + + Webserv test Something + + +

Webserv in Test

+
+

Time to submit something:

+
+ + +
+ + From a69273b88eb5599b04fd288390f0965fd8d6a393 Mon Sep 17 00:00:00 2001 From: Me Date: Fri, 12 Aug 2022 23:45:13 +0200 Subject: [PATCH 2/8] fixed an autoindex issue, working on uploading files --- default.config | 16 +++++++++ srcs/Client.cpp | 2 +- srcs/cgi-bin/upload_file.php | 64 ++++++++++++++++++++++++++++++++++++ srcs/webserv/method_get.cpp | 12 +++++-- srcs/webserv/request.cpp | 2 +- www/test/submit_form.html | 7 ++-- 6 files changed, 95 insertions(+), 8 deletions(-) create mode 100644 srcs/cgi-bin/upload_file.php diff --git a/default.config b/default.config index 088b63d..41bc784 100644 --- a/default.config +++ b/default.config @@ -15,6 +15,22 @@ server { error_page 404 ./www/error_pages/error_404.html; + +# something to do with /upload + + location /upload { + root ./www/test/; + index submit_form.html; + upload_dir ./www/uploaded/; + cgi_ext php; + } + + location /uploaded { + autoindex on; + root ./www/uploaded/; + } + + location /list { autoindex on; } diff --git a/srcs/Client.cpp b/srcs/Client.cpp index 5b2e8a5..db07f09 100644 --- a/srcs/Client.cpp +++ b/srcs/Client.cpp @@ -92,7 +92,7 @@ void Client::parse_request_headers(std::vector &servers) _parse_request_fields(); // DEBUG -//print_client("headers"); +print_client("headers"); if (status) return; diff --git a/srcs/cgi-bin/upload_file.php b/srcs/cgi-bin/upload_file.php new file mode 100644 index 0000000..b3786cf --- /dev/null +++ b/srcs/cgi-bin/upload_file.php @@ -0,0 +1,64 @@ +#! /bin/bash/php + + + + + 500000) { + echo "Sorry, your file is too large."; + $uploadOk = 0; +} + +// Allow certain file formats +//if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" +//&& $imageFileType != "gif" ) { + // echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; + // $uploadOk = 0; +//} + +// Check if $uploadOk is set to 0 by an error +if ($uploadOk == 0) { + echo "Sorry, your file was not uploaded."; +// if everything is ok, try to upload file +} else { + if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { + echo "The file ". htmlspecialchars( basename( $_FILES["fileToUpload"]["name"])). " has been uploaded."; + } else { + echo "Sorry, there was an error uploading your file."; + } +} +?> + + diff --git a/srcs/webserv/method_get.cpp b/srcs/webserv/method_get.cpp index a0bcd7c..f60152e 100644 --- a/srcs/webserv/method_get.cpp +++ b/srcs/webserv/method_get.cpp @@ -105,11 +105,15 @@ void Webserv::_autoindex(Client *client, const std::string &path) { std::cout << "made it to _autoindex\n"; +// std::cout << "client target: " << client->get_rq_target() << '\n'; + + + std::string dir_list; DIR *dir; struct dirent *ent; - std::cout << "location root: " << client->assigned_location->root << " location path: " +// std::cout << "location root: " << client->assigned_location->root << " location path: " << client->assigned_location->path << '\n'; std::cout << "Path in auto is: " << path << '\n'; @@ -123,11 +127,13 @@ void Webserv::_autoindex(Client *client, const std::string &path) /* print all the files and directories within directory */ while ((ent = readdir (dir)) != NULL) { - std::cout << "ent: " << ent->d_name << '\n'; +// std::cout << "ent: " << ent->d_name << '\n'; if (strcmp(".", ent->d_name) == 0) continue ; dir_list.append("assigned_location->path + "/"); + dir_list.append(client->get_rq_target()); + if (dir_list[dir_list.size() - 1] != '/') + dir_list.push_back('/'); dir_list.append(ent->d_name); dir_list.append("\">"); dir_list.append(ent->d_name); diff --git a/srcs/webserv/request.cpp b/srcs/webserv/request.cpp index 8b159f3..4e2a9ab 100644 --- a/srcs/webserv/request.cpp +++ b/srcs/webserv/request.cpp @@ -52,7 +52,7 @@ int Webserv::_read_request(Client *client) } client->raw_request.append(buf, ret); - print_special(client->raw_request); +// print_special(client->raw_request); if (!client->header_complete) { diff --git a/www/test/submit_form.html b/www/test/submit_form.html index 0688854..e8673c6 100644 --- a/www/test/submit_form.html +++ b/www/test/submit_form.html @@ -7,9 +7,10 @@

Webserv in Test


Time to submit something:

-
- - + + + +
From 3495ff19a8bdd44933e75227a0782b0a3f3d8265 Mon Sep 17 00:00:00 2001 From: Me Date: Sat, 13 Aug 2022 03:01:41 +0200 Subject: [PATCH 3/8] mucked about with Telnet --- default.config | 12 +++++++++--- srcs/cgi-bin/upload_file.php | 5 +++-- srcs/webserv/method_get.cpp | 2 +- telnet_test.sh | 37 ++++++++++++++++++++++++++++++++++++ telnet_test2.sh | 8 ++++++++ www/test/submit_form.html | 5 +++-- 6 files changed, 61 insertions(+), 8 deletions(-) create mode 100755 telnet_test.sh create mode 100755 telnet_test2.sh diff --git a/default.config b/default.config index 41bc784..a287ed2 100644 --- a/default.config +++ b/default.config @@ -21,15 +21,21 @@ server { location /upload { root ./www/test/; index submit_form.html; - upload_dir ./www/uploaded/; - cgi_ext php; +# upload_dir ./www/uploaded/; +# cgi_ext php; } location /uploaded { - autoindex on; +# autoindex on; root ./www/uploaded/; + upload_dir ./www/uploaded/; } +# location /srcs/cgi-bin/ { +# root ./srcs/cgi-bin/; +# allow_methods POST; +# cgi_ext php; +# } location /list { autoindex on; diff --git a/srcs/cgi-bin/upload_file.php b/srcs/cgi-bin/upload_file.php index b3786cf..251aefb 100644 --- a/srcs/cgi-bin/upload_file.php +++ b/srcs/cgi-bin/upload_file.php @@ -10,8 +10,9 @@ # echo("File was uploaded successfully!"); // this part needs to be grabed from POST uri -//$target_dir = "./www/uploaded/"; -$target_dir = $_POST["upload_dir"]; +$target_dir = "./www/uploaded/"; +//$target_dir = $_POST["upload_dir"]; +//$target_dir = $_GET["upload_dir"]; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $fileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); diff --git a/srcs/webserv/method_get.cpp b/srcs/webserv/method_get.cpp index f60152e..f2ecc16 100644 --- a/srcs/webserv/method_get.cpp +++ b/srcs/webserv/method_get.cpp @@ -114,7 +114,7 @@ void Webserv::_autoindex(Client *client, const std::string &path) struct dirent *ent; // std::cout << "location root: " << client->assigned_location->root << " location path: " - << client->assigned_location->path << '\n'; +// << client->assigned_location->path << '\n'; std::cout << "Path in auto is: " << path << '\n'; if ( (dir = opendir(path.c_str()) ) != NULL) diff --git a/telnet_test.sh b/telnet_test.sh new file mode 100755 index 0000000..872367e --- /dev/null +++ b/telnet_test.sh @@ -0,0 +1,37 @@ +#! /bin/bash + +# no idea what we're doing here... + +PORT=80 +METHOD="GET" +PATH="/" +HOST="localhost $PORT" + +START="open $HOST" + +L1="$METHOD $PATH HTTP/1.1" + +run() +{ +# echo "this is a test" + +# $TEL_START + +# spaw telnet localhost $PORT + + echo $START + echo +# sleep 1 + echo $L1 + echo "Host: $HOST" + echo + echo + + +} + + + +#echo $START +run + diff --git a/telnet_test2.sh b/telnet_test2.sh new file mode 100755 index 0000000..a73144b --- /dev/null +++ b/telnet_test2.sh @@ -0,0 +1,8 @@ +#! /usr/bin/expect + +set timeout 20 +set Host "localhost 80" + +spawn telnet $Host + + diff --git a/www/test/submit_form.html b/www/test/submit_form.html index e8673c6..c4d556b 100644 --- a/www/test/submit_form.html +++ b/www/test/submit_form.html @@ -7,8 +7,9 @@

Webserv in Test


Time to submit something:

-
- + + +
From c3240b8618a7bde10b23994601c34e73af54d0b2 Mon Sep 17 00:00:00 2001 From: Me Date: Sat, 13 Aug 2022 03:52:33 +0200 Subject: [PATCH 4/8] i found a mistake but still doesn't work... --- telnet_test.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/telnet_test.sh b/telnet_test.sh index 872367e..0b6439b 100755 --- a/telnet_test.sh +++ b/telnet_test.sh @@ -5,9 +5,10 @@ PORT=80 METHOD="GET" PATH="/" -HOST="localhost $PORT" +HOST="duckduckgo.com" +HOST_FULL="$HOST $PORT" -START="open $HOST" +START="open $HOST_FULL" L1="$METHOD $PATH HTTP/1.1" @@ -19,8 +20,9 @@ run() # spaw telnet localhost $PORT - echo $START - echo +# echo $START + telnet $HOST_FULL +# echo # sleep 1 echo $L1 echo "Host: $HOST" From ebd0fda52c9393d5b0eca3112bae705098cfb1b2 Mon Sep 17 00:00:00 2001 From: Me Date: Sat, 13 Aug 2022 05:57:50 +0200 Subject: [PATCH 5/8] more mucking about with telnet --- telnet_test.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/telnet_test.sh b/telnet_test.sh index 0b6439b..cd2d0e5 100755 --- a/telnet_test.sh +++ b/telnet_test.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/bin/bash # no idea what we're doing here... @@ -20,12 +20,14 @@ run() # spaw telnet localhost $PORT -# echo $START - telnet $HOST_FULL + echo "$START" +# telnet $HOST_FULL # echo -# sleep 1 - echo $L1 - echo "Host: $HOST" + sleep 1 +# echo "$L1" +# echo "GET / HTTP/1.1" +# echo "Host: duckduckgo.com" +# echo "Host: $HOST" echo echo From dda32c759a475034f72c9029c2a88a2c8684f65b Mon Sep 17 00:00:00 2001 From: Eric LAZO Date: Sat, 13 Aug 2022 22:38:31 +0200 Subject: [PATCH 6/8] decent start to bash tester --- .gitignore | 2 + srcs/webserv/method_get.cpp | 3 +- telnet_test.sh | 140 +++++++++++++++++++++++++++++------- telnet_test2.sh | 20 ++++-- 4 files changed, 133 insertions(+), 32 deletions(-) diff --git a/.gitignore b/.gitignore index 589577a..88c4209 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ webserv *.log large.jpg +webserv_tester +webserv_tester2 diff --git a/srcs/webserv/method_get.cpp b/srcs/webserv/method_get.cpp index f2ecc16..661b287 100644 --- a/srcs/webserv/method_get.cpp +++ b/srcs/webserv/method_get.cpp @@ -131,7 +131,8 @@ void Webserv::_autoindex(Client *client, const std::string &path) if (strcmp(".", ent->d_name) == 0) continue ; dir_list.append("
get_rq_target()); +// dir_list.append(client->get_rq_target()); + dir_list.append(client->get_rq_abs_path()); if (dir_list[dir_list.size() - 1] != '/') dir_list.push_back('/'); dir_list.append(ent->d_name); diff --git a/telnet_test.sh b/telnet_test.sh index cd2d0e5..37efd05 100755 --- a/telnet_test.sh +++ b/telnet_test.sh @@ -1,41 +1,131 @@ -#!/bin/bash +#! /bin/bash -# no idea what we're doing here... +# you need to put absolutely everything in "" -PORT=80 -METHOD="GET" -PATH="/" -HOST="duckduckgo.com" -HOST_FULL="$HOST $PORT" +#port="80" +port="4040" +path="/" +#host="duckduckgo.com" +host="localhost" -START="open $HOST_FULL" +########## +# Colors +########## -L1="$METHOD $PATH HTTP/1.1" -run() +_GREY='\033[30m' +_RED='\033[0;31m' +_GREEN='\033[32m' +_YELLOW='\033[33m' +_BLUE='\033[34m' +_PURPLE='\033[35m' +_CYAN='\033[36m' +_WHITE='\033[37m' +_END='\033[0m' + + + + + + +methods=(GET POST DELETE GUMBALL) + +#ports=($port ($port + 1)) + +https=(HTTP/1.1 HTTP/1.0) + + + +run_telnet() { -# echo "this is a test" - -# $TEL_START - -# spaw telnet localhost $PORT - - echo "$START" -# telnet $HOST_FULL -# echo + echo "open $host $port" sleep 1 -# echo "$L1" -# echo "GET / HTTP/1.1" -# echo "Host: duckduckgo.com" -# echo "Host: $HOST" + echo "$l1" + echo "$header" +# echo +## echo $body +# echo +# echo + echo echo + sleep 1 + +# ret = $(arg | telnet) + +} + +run_a_test() +{ + echo "----- $test_name -----" + echo +# run_telnet +# echo ${pid} + + run_telnet | telnet +# run_telnet + + echo + echo "----- end of test -----" +} + +run_all() +{ +# open_a_connection + +# run_a_test | telnet + + + test_to_run="$valid_get" + test_name=$valid_get_name + +# l1="$test_to_run" + header="Host: $host" + body= + +#while something i change headers + + for i in "${methods[@]}" + do + test_name="Test Method $i" + l1="$i $path ${https[0]}" + expected_result="something" + run_a_test + echo -e "${_RED}$expected_result${_END}" + echo + done + + +# consider running several tests in a single telnet connection } +# open telnet localhost 4040 +# GET / HTTP/1.1 +# Host: localhost +# more header stuff +# +# maybe a body + + + + +run_all + + + + + + + + + + + + + + -#echo $START -run diff --git a/telnet_test2.sh b/telnet_test2.sh index a73144b..204ff98 100755 --- a/telnet_test2.sh +++ b/telnet_test2.sh @@ -1,8 +1,16 @@ -#! /usr/bin/expect - -set timeout 20 -set Host "localhost 80" - -spawn telnet $Host +#! /bin/bash +echo "open duckduckgo.com 80" +sleep 1 +echo "GET / HTTP/1.1" +echo "Host: duckduckgo.com" +echo +echo +sleep 2 +#( +#echo open duckduckgo.com 80 +#echo "GET / HTTP/1.1" +#echo "Host: duckduckgo.com" +#echo "exit" +#) | telnet From ddafa229c65f8ac60a9f287cbefbc67ea865f4ac Mon Sep 17 00:00:00 2001 From: Me Date: Sun, 14 Aug 2022 03:49:29 +0200 Subject: [PATCH 7/8] something done to the telnet tester --- telnet_test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telnet_test.sh b/telnet_test.sh index 37efd05..5c199ca 100755 --- a/telnet_test.sh +++ b/telnet_test.sh @@ -95,6 +95,9 @@ run_all() echo done +# do a thing where you pass an array as parameter and based on that it +# decides which test to run and then you can loop through the arrays you pass + # consider running several tests in a single telnet connection From 683dbadb9157a4c29d9f79f6ff6c13ed46a8923d Mon Sep 17 00:00:00 2001 From: Eric LAZO Date: Sun, 14 Aug 2022 21:26:57 +0200 Subject: [PATCH 8/8] better telnet tester --- 1 | 3 ++ telnet_test.sh | 125 +++++++++++++++++++++++++---------------------- test_header.txt | 11 +++++ test_template.sh | 61 +++++++++++++++++++++++ 4 files changed, 142 insertions(+), 58 deletions(-) create mode 100644 1 create mode 100644 test_header.txt create mode 100644 test_template.sh diff --git a/1 b/1 new file mode 100644 index 0000000..3b77138 --- /dev/null +++ b/1 @@ -0,0 +1,3 @@ + +------ + diff --git a/telnet_test.sh b/telnet_test.sh index 5c199ca..3d2c3d6 100755 --- a/telnet_test.sh +++ b/telnet_test.sh @@ -2,11 +2,6 @@ # you need to put absolutely everything in "" -#port="80" -port="4040" -path="/" -#host="duckduckgo.com" -host="localhost" ########## # Colors @@ -24,30 +19,30 @@ _WHITE='\033[37m' _END='\033[0m' +test_file=$1 +source $test_file + +connect_to_telnet="open $host $port" - - -methods=(GET POST DELETE GUMBALL) - -#ports=($port ($port + 1)) - -https=(HTTP/1.1 HTTP/1.0) - - - -run_telnet() +start_telnet() { echo "open $host $port" sleep 1 - echo "$l1" - echo "$header" +} + +run_telnet() +{ + echo "$connect_to_telnet" + sleep 1 + echo -e "$request" +# echo "$l1" +# echo "$header" # echo -## echo $body +# echo $body # echo # echo - echo echo sleep 1 @@ -55,69 +50,83 @@ run_telnet() } +run() +{ + echo "$connect_to_telnet" + sleep 1 + + run_this_test + + +} + + + run_a_test() { + { echo "----- $test_name -----" - echo + echo -e "$_RED$request$_END" + } &> test.log + # run_telnet # echo ${pid} +# echo -e "$_END---" - run_telnet | telnet + echo -e "$request" | telnet +# run_telnet | telnet # run_telnet - echo - echo "----- end of test -----" +# echo +# echo "----- end of test -----" } run_all() { -# open_a_connection + echo -# run_a_test | telnet +# ./webserv $config_file 2>&1 > webserv.log & - - test_to_run="$valid_get" - test_name=$valid_get_name - -# l1="$test_to_run" - header="Host: $host" - body= + #while something i change headers - for i in "${methods[@]}" - do - test_name="Test Method $i" - l1="$i $path ${https[0]}" - expected_result="something" - run_a_test - echo -e "${_RED}$expected_result${_END}" - echo - done - -# do a thing where you pass an array as parameter and based on that it -# decides which test to run and then you can loop through the arrays you pass - - -# consider running several tests in a single telnet connection - +# for i in "${methods[@]}" +# do +# expected_result="something" +# run_a_test +# echo -e "${_GREEN}$expected_result${_END}" +## echo +# done } -# open telnet localhost 4040 -# GET / HTTP/1.1 -# Host: localhost -# more header stuff -# -# maybe a body +####### +# This is where stuff is launched +####### + +rm -rf test.log +rm -rf telnet.out + +#./webserv $config_file 2>&1 > webserv.log & run_all +#./webserv $config_file 2>&1 > webserv.log & +#./webserv $config_file &> /dev/null & +./webserv $config_file &> webserv.log & +#./webserv $config_file 1>&1 > webserv.log & +#run_all +#run_this_test +echo -e "${_GREEN}Running Telnet Test on '$test_name'${_END}" -run_all - - +sleep 1 + +run | telnet >> telnet.out +#run | telnet + +pkill webserv diff --git a/test_header.txt b/test_header.txt new file mode 100644 index 0000000..bbe1f78 --- /dev/null +++ b/test_header.txt @@ -0,0 +1,11 @@ + +config_file=... +port=... + +# Host: ... + + + + +# the correct response +... diff --git a/test_template.sh b/test_template.sh new file mode 100644 index 0000000..6a057f4 --- /dev/null +++ b/test_template.sh @@ -0,0 +1,61 @@ +#! /bin/bash + +test_name="Template test all good" + +config_file="default.config" +port=4040 +host="localhost" + +paths=("/") # you can add many +methods=("GET" "POST" "DELETE") +#methods=("GET") +httpz=("HTTP/1.1") + + + + +# the parts we will send to webserv + + +# let main.sh handle the l1 + +l1="${methods[0]} ${paths[0]} ${https[0]}" + +header="Host: $host" +body= + + +run_this_test() +{ + + for i in "${methods[@]}" + do + l1="$i ${paths[0]} ${httpz[0]}" + request="$l1\n$header\n$body\n" + { + echo "----- $test_name -----" + echo -e "$_RED$request$_END" + } &>> telnet.out +# } &>> test.log +# } 2>>&1 +# } &>> /dev/stdout + echo -e "$request" + sleep 1 +# { +# echo -e "\n------\n" +# } > /dev/stdout + # echo -e "\n\n\n------\n\n\n" >> telnet.out + # echo -e "\n\n\n------\n\n\n" &> /dev/stdout + echo -e "\n\n" >> telnet.out +# echo -e "\n\n------\n\n" >> telnet.out + # echo -e "\n------\n" > /dev/stdout +# run_a_test +# echo + done + +} + + + +# expected result... +