From eaf5ddf41a37db39476ca879373ccd19fa228c94 Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Wed, 14 Jun 2023 10:25:10 +0800 Subject: [PATCH 01/12] add README821d31e4f75848ca30bf5b5bede06256907b09f0 --- 1 | 126 ++ 2 | 3 +- bash-5.1/1.sh | 21 + bash-5.1/gen.sh | 32 + bash-5.1/x.sh | 3082 +++++++++++++++++++++++++++++++++++++++++++++++ gen.sh | 11 +- record.txt | 1 + x.sh | 334 +++-- 8 files changed, 3413 insertions(+), 197 deletions(-) create mode 100755 bash-5.1/1.sh create mode 100755 bash-5.1/gen.sh create mode 100644 bash-5.1/x.sh mode change 100644 => 100755 gen.sh mode change 100644 => 100755 x.sh diff --git a/1 b/1 index 5c7c1c38..576d0ffb 100644 --- a/1 +++ b/1 @@ -6,3 +6,129 @@ d337102476240db1552c114113fb8316a0b9770f $ 添加jobs rust code b33fe3ce7039944a5a18aefcc51c214a174bb25e $ 优化指针传参问题 7e248b9bceea2cb5a53fa8267db60951966f0d8d $ Merge "优化指针传参问题" into rustdev ec052778560599039fdbc50419d367acaa63b00a $ refactor: add r_execute_cmd function +9b18ec1b6383bea95912c78856c0442e5185304c $ refactor: modify execute_cmd function,part 1 +1efade178d50e6e98946958ab076d1e1cc3d4676 $ 添加fg_bg 命令 rust 代码 +5a92722cbfd79d4f44b53d29c644de9449d9a9b5 $ Merge "refactor: modify execute_cmd function,part 1" into rustdev +31346f4ffaae817b3242928f473619b7d06d94bd $ 添加cd rust 源码,并优化指针判空写法 +8370b614793b54261b1ef08bdeb0aa36eb8f01a2 $ 1 添加fc命令源码 2 优化代码规范,去掉多余的空格 3 添加注册函数 +f86f4f2bf1290c6874e817b94ab3a5cdb767b12a $ 1 添加getsopts 命令 rust 源码 2 优化二级指针偏移 +ca56a5df9aec33adeb75143077d781d5a807593e $ 1 添加source rust源码 2 纠正STREQN 的实现 +ea1d13cf401ea9f93ebe5f4a232c828ed39ffb3b $ builtins_rust: update read plugin +ddff45d647b3214c0bbb0c2a26dfffbe1ab4d6e1 $ 1 declare 命令 rust 源码 +7edb13a39895925afb2a0b1d3864470aeed94485 $ builtins_rust: add history plugin +cb7247d1cf0deff99be280bc5675b1e3376fda6a $ builtins_rust: add kill plugin +d89ed9d3662658da4ff61a5e98d4623f9c791598 $ 1 添加bash rust重构pushd 命令源码 +ecff8a6bde802a83b39715d2081706049bc403c8 $ Merge "builtins_rust: add kill plugin" into rustdev +99fc02b24c9c7eb3afef7387233e5fddf9c6cf11 $ builtins_rust: add let plugin +af476a9df7f9d589fcca6aa83ca9a57b39a2a8f6 $ builtins_rust: add mapfile plugin +39e06294409d398e050d328f3fd09eaf395087e9 $ 1 添加bash rust重构complete命令 +13af07fe9741f6b2db3c85ca4ead4b684fe1ba76 $ builtins_rust: add printf plugin +040c3852e88aced0f9bedf6ad35cf4ca24ba20b4 $ builtins_rust: add return plugin +e7d0c3856c9b028da878a4f0fac38b3e828da2e5 $ builtins_rust: add shift plugin builtins_rust: add times plugin builtins_rust: add suspend plugin builtins_rust: add test plugin +caecab0a8c31785080b688f615abe40042ef3d81 $ rush: build with rust so +5987ab26e969a62593146afaef3f6180fa566c42 $ rust: modify dylib to staticlib +0dc6bb5a20af927e7c0048dcb97b89ee878de9e2 $ rust: add colon and builtin +f702f18ebda6077ab396597a807b742ff42f9718 $ builtins_rust: add trap plugin +c7d273a9a8614cd0b4cf9fe6ddddd1690df7f3a0 $ builtins_rust:add alias exit help +c9e34358dc4d3932d4f9a02f97493d622431fc11 $ rm doc +925106ec5a9c695052d0ed4e96e7684f09d325e0 $ builtins_rust: add setattr plugin +460e1f5130d8bb2a75d770296996fb35fa911592 $ add wait umask printf history eval caller bind alias +fee860b67d05e315e66d3507480e4eb22cb4e2ca $ add break ulimit type +38143b58456407750e4f0563dfcfebf27f641bd4 $ add exec and common, modify cd +fd5373f3df3ce757400685b243c3d38e413312be $ Refactoring code +341c12df35c6343148d264c59f61661684f1555a $ Refactoring code +36dcb3a95e6d2ad7ba1b53796d6f1051002c42f0 $ double commit, cause error Revert "Refactoring code" +f04d51713bffbeee31aee689b08fd0220c8ca75d $ modify common +6466675c76bcbc771c5939410065d97ddda05ca4 $ add set command +554f7a914ed1a53c820a1e94d00726b3253d7903 $ fix compile error +411367dd7a0a2b40c7b921dd6c47dcf5e9059158 $ modify command.rs file +1fb55c5ecf5576943ba3643c2b76f8a04a5fe152 $ fix coredump +070aa64329ebfbdec61bd04e36f69cbbfcdbcd48 $ fix shopt setflag error +df7984f479c17805e976634718c63b5034cdd517 $ fix shopt error +70b4faaf74e318d95e30c697592f84b571a0fe24 $ fix build error +0e0395002a236f4e1c8397579b79954e0dc2a3f5 $ modify jobs +95a4108faf4b7093700e2d9abf43798fc8f1aa35 $ refact bind +717301e3070467f19d156bc01c1b46c8aa6b9905 $ merge common from alias to eval +f045dbbd795ae6c0e35c694ce5bbc670e45e3cc0 $ refact exec exit +82d6bb32c9bf058106dafec13d81fd61faeb01b3 $ check mapfile printf read suspend test time trap and merge refact common +10cd55321a7387a9ff00915920b884d5717372ae $ Unified Interface parameter type and Implement factory patterns +9222a0d2cec8bfa43152b8a1da12b51046128068 $ fix history can not -d error +e51b65d434a34e8cc56cb94b65acdc339020207c $ modify read -t -d -e -n +724977750ec2acaf542bbec602e06c49d73a217c $ use static mut var +79c007027d5a17e7c6a3183f6e7c0f38381bbb6b $ succeed called factory +0f7a654ee1022599fcb37478283b6734f83016ac $ modify exec +e7be711a2d3501268fe1db0171885580480894c7 $ fixed some command segmentation fault +5b352d9f227a436170d90cd861b576a27de649c4 $ fixed readonly and export cannot jump loop +552bc4a75c9b905a950c2ca699435452b65f9d45 $ fixed test suspend shift error +5055706c68c1b5a574e8c345acde65b9c490306f $ fixed source error +e361ba0cbb7a4f819b96ef05329cb9b63e3c7642 $ fixed cmd --help error +b10fbeaa6b641b3e83d3144fb6e0de0253be7ec1 $ add usage for ulimit +97b2b53031602fe0a6ab639a2078a399d12f96d4 $ convert i8 to c_char +b92d42bd77ba782f7c5546c41278e1665f7783f5 $ git add cargo vendor files +1194dc2c7d5ca8f0ec096a25faccd066ae1c57bc $ add translations file +cb394fcaa843187d6d24ad5fe33998e78c6c9527 $ add translatins file 2 +038c321f2f28a1b8688c68c86974d912b38a5803 $ add translation file 3 +f688c1d7c41fe6ae6d27f5b82251402bde322339 $ modify execute retrun error call read: factory:read->return +89b6ba202761304458c7faffc9ad1a7c5de0172f $ remove print msg +8417230f57e8eaea155ab6809bf88c4ee91c0aff $ sync from rpmbuild,remove doc and other file +3d84851489913216c57bad0a471725f167308cee $ fix kill -l and trap -l +72069ebbbfd134eec710ab17660e4d67b9f307ac $ modify transfile path +1887d5377ba409fb3692805654de96165cc85161 $ Merge "modify transfile path" into rustdev +20b615f01c67efa857592872ce48134d2e9af5f2 $ fix: 160365 rash disown execute error without parameter +e64650fdabf3b511d482b687399f5b0f50464a1d $ realize some command translation +0b339314d05ca826831e071b3405abe09c463765 $ change LANGUAGE to LANG +42cc1a5b57a384c6f9028251078e72ed7a7beafd $ Merge "realize some command translation" into rustdev +e890c4eb63ebcc754f1669b1445b448db96a4da9 $ Merge "change LANGUAGE to LANG" into rustdev +fe184ac9ef5882c2c4fffc0912bb7ab62ffaeb93 $ fix 160413 umask fmt error +f1567e0f82b3ca20388da8d412e5957acf64d5b0 $ fixed help -m err +a545f8fd3b81d3e6b19b4a868f1d8ee0d2e5ed73 $ Merge "fix 160413 umask fmt error" into rustdev +2d8cdcf350720956b0fda3c64f93d013d2ee17e2 $ fix :160145 alias fmt error +06ca889c4860d1e4e25d2dce77d991d11919a307 $ fix: disown -r option error +c750605cf5c673b50183671f79858ae154c407a0 $ change opt variant to mut +808801d81756188f841510017dbaeace519da23c $ fix fc command +68e37bbcc3d58e84df4b4854f69d0673f7cc7d58 $ Merge "fix fc command" into rustdev +8e0d9c53896edd0eb62c6e0ba4e424c1fc925230 $ realize translation command --help +7c1d6e6eaaa602936c960663bacaf80e3dcf3965 $ fix pushd -l, popd -l, dirs command +5dc4c4767ea225b5270f998a9cb06bd2b368118c $ fixed declare -i err +972471884b58c115f9c611a84107aa938c058a32 $ fixed declare error +102dae472a96e7c811f5e99b3c756887da4253a4 $ fix typeseterror:exec_cmd: typeset to declare +06d456ee7b52becc2e77875c9a0a5d4308bd1828 $ change help longdoc format +1d30a26ae0817569e83d69e84a08e7999dbecc68 $ modify project name rash->utshell +d0537a70467845b4caf25863006bbd142c2241dd $ fixed declare -p error +fb327d67a0e9cad54228b940a895d4d1c9ab5ad0 $ chage ptr move as offset +a06caded61b6a43bb89159be04a0eb9af738e711 $ Merge "fix pushd -l, popd -l, dirs command" into rustdev +13556a85f76698547e08c7fa46b8a88301dc73a5 $ fixed ulimit cmd print format err +e76865581185412bd15fb89ef5e7e36258212150 $ Merge "fixed ulimit cmd print format err" into rustdev +d9ed5098a46ac6bcd9addc2c1e97a3195ac022bd $ fix printf %f +ad9027e057c5a227be8159b9a6eb31d5e8641309 $ change en-US translztion format +204c0925c7d148257a8d6102e82e4e8dccf53cb3 $ fixed declare -a err +fea9649b3799f2e6de35ebca49b4c771f73d1c92 $ fix type -a +690d56a0f3209fdd4559d855674e78d8107920b8 $ fix enable -a +3788e0451fcd072fabf44cf96de23d723676c13b $ Merge "change en-US translztion format" into rustdev +e5b99f66029850a11f429c19fce3f614368a2748 $ Merge "fix enable -a" into rustdev +da17d91645784496a5edcdde6f882389397127e1 $ Merge "fixed declare -a err" into rustdev +af506d1a9f0e9542545f613db3c06887929d6d12 $ fix typeset -f function +90a00b5509b085d1439800dff068bd96a26d277a $ Merge "fix typeset -f function" into rustdev +3b850c3821bdc84882ef7ed8b779555e179afd25 $ add traslations for type +ada589369c646185763a8c5253df5955a77e5d61 $ fix complete and compgen bug +eab505fb31093598e39e6e7d3e39448e279923f2 $ fix memery err +f49cd3a3cbdb079d4f9aa09b178f6024dabca168 $ fix enable -n +aedfa436429724000dfdbc042e5ec6cf149b5fc3 $ Merge "fix enable -n" into rustdev +3ba426b53b2c4bf27c12eb98c4de176df471c46d $ add translation for let kill bind +77228f3e3692f3aae400c6ad37d795fe3fe24bf2 $ changed function location +87f5bc0f673ea1d7ceb8de404a3fd3621b4c17ff $ modify enable -n commind +9b92233e6e928cb06a7c13d57aa15e0185bd3791 $ fix mapfile -d +2e2ae9165d48c3b7dd2e1a6cb86fd035591060cf $ add safe protocol for alias and hash +eb8b0dd7ddd7e11f78b6528ea50925b04eb3ab7d $ add u_src dir +6d72fd0a3ccc1063c57467015616ee923d2ff7e2 $ Merge "add safe protocol for alias and hash" into rustdev +ac5c53099a6515a85e977ccf9afbf4e35c46a5ad $ change translate file +bc1080dd99fbc11c1f3c80131c776878523c30c2 $ fix:193533 utshell环境,Ctrl+D退出会话时,提示exit_builtin +1a86263c1c045c8c0bf59faa61de8897ba71082e $ fix:193535.history -p mount和用例中预期不符 +5e7f126369b7c5be332ea82cae8534f4499b3a90 $ fix:193581 utshell环境,未执行kill -CONT 恢复进程时,执行ctrl+C无法结束wait -f 进程 +97c737d22ff3adf518655aa848b6531a548b7779 $ fixed 193557 declare 命令变量输出异常,和用例中预期不一致 +7e07d17473de10c94e37a2fddb63c39c00702be2 $ Merge "fixed 193557 declare 命令变量输出异常,和用例中预期不一致" into rustdev +f9f38431efe992eb9e7a0928968303643a6f0807 $ fixed declare command brackets's format +6cad4846183d77119319c2236c5c337e8f632c9a $ Merge "fixed declare command brackets's format" into rustdev +7cf4c921dd95788697bd1f0ec49b6d918359b410 $ add print_cmd reconstruction +c74756216fafb31404717cacfef813637b43d1f3 $ delete command_h.re test +a9f5a77741d8d425cadab98626379c37045958e3 $ generate header.rs from .h header files diff --git a/2 b/2 index b8a94130..704ff82f 100644 --- a/2 +++ b/2 @@ -132,5 +132,4 @@ d337102476240db1552c114113fb8316a0b9770f $ 添加jobs rust code 9edf0cde85de2eb55837061e75b2cf882cc11e55 $ refactor: move builtins_org to builtins d8b5fe4e7673b03007c243172537bc84b7d7c558 $ refactor: add rust framework for builtins. 821d31e4f75848ca30bf5b5bede06256907b09f0 $ init -4e5ff3911664c3535659c83e05c05d6d809e57d5 $ add README - +4e5ff3911664c3535659c83e05c05d6d809e57d5 $ add README \ No newline at end of file diff --git a/bash-5.1/1.sh b/bash-5.1/1.sh new file mode 100755 index 00000000..bcc830c9 --- /dev/null +++ b/bash-5.1/1.sh @@ -0,0 +1,21 @@ +cd /home/huan/gerrit/bash/ +git log --pretty=format:"%H $ %s" >2 +cat 2|tac >1 + +while read line ; do echo $line|awk -F'$' '{ +print " cd /home/huan/gerrit/utshell/ ; "; +print " git checkout master; git pull ;"; +print " git checkout -b " $1 " ; "; +print " cd /home/tong/src/bash/ ;"; +print "git reset --hard ",$1," ; "; +print "cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell/"; +print "cd /home/huan/gerrit/utshell/"; +print "echo \"" $1 "\" >> record.txt"; +print "git add .;" +print "git commit -m \"" , $2,"\""; +print "git push --set-upstream origin " $1; +print "git checkout master; "; +print "cd /home/huan/gerrit/bash "; +print "sleep 10"; +print "read" +}' ; done < ../1>./1.sh diff --git a/bash-5.1/gen.sh b/bash-5.1/gen.sh new file mode 100755 index 00000000..5e6dbd5b --- /dev/null +++ b/bash-5.1/gen.sh @@ -0,0 +1,32 @@ +export utshell_dir=/home/huan/gerrit/bash; +export euler_dir=/home/huan/gerrit/utshell; +export count=0`tail -1 ${euler_dir}/record.txt`; +echo $euler_dir +echo $utshell_dir +while read line ; do +let count=count+1; +echo $line|awk -F'$' '{ +print "echo cd " ENVIRON["euler_dir"] ";"; +print "cd " ENVIRON["euler_dir"] ";"; +print "echo git checkout -b bv" ENVIRON["count"] ";"; +print "git checkout -b bv" ENVIRON["count"] ";"; +print "cd " ENVIRON["utshell_dir"] ";"; +print "echo cd " ENVIRON["utshell_dir"] ";"; +print "git reset --hard ",$1," ; "; +print "echo git reset --hard ",$1," ; "; +print "cp -r " ENVIRON["utshell_dir"] "//* " ENVIRON["euler_dir"] ";" +print "echo cp -r " ENVIRON["utshell_dir"] "//* " ENVIRON["euler_dir"] ";" +print "cd " ENVIRON["euler_dir"]; +print "echo cd " ENVIRON["euler_dir"] ";" +print "echo " ENVIRON["count"] " >> record.txt"; +print "echo echo " $1 " to record.txt ; "; +print "git add .;" +print "echo git add .;" +print "git commit -m \"" $2 "\""; +print "echo git commit -m " $2," ;"; +print "git push origin bv" ENVIRON["count"] ; +print "echo git push origin bv" ENVIRON["count"] ";"; +print "cd " ENVIRON["utshell_dir"]; +print "echo cd " ENVIRON["utshell_dir"] ";" +print "read "; +}' ; done < ../1 >./x.sh diff --git a/bash-5.1/x.sh b/bash-5.1/x.sh new file mode 100644 index 00000000..d005c705 --- /dev/null +++ b/bash-5.1/x.sh @@ -0,0 +1,3082 @@ +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv1; +git checkout -b bv1; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 4e5ff3911664c3535659c83e05c05d6d809e57d5 ; +echo git reset --hard 4e5ff3911664c3535659c83e05c05d6d809e57d5 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 1 >> record.txt +echo echo 4e5ff3911664c3535659c83e05c05d6d809e57d5 to record.txt ; +git add .; +echo git add .; +git commit -m " add README821d31e4f75848ca30bf5b5bede06256907b09f0 " +echo git commit -m add README821d31e4f75848ca30bf5b5bede06256907b09f0 ; +git push origin bv1 +echo git push origin bv1; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv2; +git checkout -b bv2; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard d8b5fe4e7673b03007c243172537bc84b7d7c558 ; +echo git reset --hard d8b5fe4e7673b03007c243172537bc84b7d7c558 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 2 >> record.txt +echo echo d8b5fe4e7673b03007c243172537bc84b7d7c558 to record.txt ; +git add .; +echo git add .; +git commit -m " refactor: add rust framework for builtins." +echo git commit -m refactor: add rust framework for builtins. ; +git push origin bv2 +echo git push origin bv2; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv3; +git checkout -b bv3; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 9edf0cde85de2eb55837061e75b2cf882cc11e55 ; +echo git reset --hard 9edf0cde85de2eb55837061e75b2cf882cc11e55 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 3 >> record.txt +echo echo 9edf0cde85de2eb55837061e75b2cf882cc11e55 to record.txt ; +git add .; +echo git add .; +git commit -m " refactor: move builtins_org to builtins" +echo git commit -m refactor: move builtins_org to builtins ; +git push origin bv3 +echo git push origin bv3; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv4; +git checkout -b bv4; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard d337102476240db1552c114113fb8316a0b9770f ; +echo git reset --hard d337102476240db1552c114113fb8316a0b9770f ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 4 >> record.txt +echo echo d337102476240db1552c114113fb8316a0b9770f to record.txt ; +git add .; +echo git add .; +git commit -m " 添加jobs rust code" +echo git commit -m 添加jobs rust code ; +git push origin bv4 +echo git push origin bv4; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv5; +git checkout -b bv5; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 59f05227deab020a56c870c2b7792104413ad4c7 ; +echo git reset --hard 59f05227deab020a56c870c2b7792104413ad4c7 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 5 >> record.txt +echo echo 59f05227deab020a56c870c2b7792104413ad4c7 to record.txt ; +git add .; +echo git add .; +git commit -m " builtins_rust: add read plugin" +echo git commit -m builtins_rust: add read plugin ; +git push origin bv5 +echo git push origin bv5; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv6; +git checkout -b bv6; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard b33fe3ce7039944a5a18aefcc51c214a174bb25e ; +echo git reset --hard b33fe3ce7039944a5a18aefcc51c214a174bb25e ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 6 >> record.txt +echo echo b33fe3ce7039944a5a18aefcc51c214a174bb25e to record.txt ; +git add .; +echo git add .; +git commit -m " 优化指针传参问题" +echo git commit -m 优化指针传参问题 ; +git push origin bv6 +echo git push origin bv6; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv7; +git checkout -b bv7; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 7e248b9bceea2cb5a53fa8267db60951966f0d8d ; +echo git reset --hard 7e248b9bceea2cb5a53fa8267db60951966f0d8d ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 7 >> record.txt +echo echo 7e248b9bceea2cb5a53fa8267db60951966f0d8d to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "优化指针传参问题" into rustdev" +echo git commit -m Merge "优化指针传参问题" into rustdev ; +git push origin bv7 +echo git push origin bv7; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv8; +git checkout -b bv8; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard ec052778560599039fdbc50419d367acaa63b00a ; +echo git reset --hard ec052778560599039fdbc50419d367acaa63b00a ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 8 >> record.txt +echo echo ec052778560599039fdbc50419d367acaa63b00a to record.txt ; +git add .; +echo git add .; +git commit -m " refactor: add r_execute_cmd function" +echo git commit -m refactor: add r_execute_cmd function ; +git push origin bv8 +echo git push origin bv8; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv9; +git checkout -b bv9; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 9b18ec1b6383bea95912c78856c0442e5185304c ; +echo git reset --hard 9b18ec1b6383bea95912c78856c0442e5185304c ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 9 >> record.txt +echo echo 9b18ec1b6383bea95912c78856c0442e5185304c to record.txt ; +git add .; +echo git add .; +git commit -m " refactor: modify execute_cmd function,part 1" +echo git commit -m refactor: modify execute_cmd function,part 1 ; +git push origin bv9 +echo git push origin bv9; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv10; +git checkout -b bv10; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 1efade178d50e6e98946958ab076d1e1cc3d4676 ; +echo git reset --hard 1efade178d50e6e98946958ab076d1e1cc3d4676 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 10 >> record.txt +echo echo 1efade178d50e6e98946958ab076d1e1cc3d4676 to record.txt ; +git add .; +echo git add .; +git commit -m " 添加fg_bg 命令 rust 代码" +echo git commit -m 添加fg_bg 命令 rust 代码 ; +git push origin bv10 +echo git push origin bv10; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv11; +git checkout -b bv11; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 5a92722cbfd79d4f44b53d29c644de9449d9a9b5 ; +echo git reset --hard 5a92722cbfd79d4f44b53d29c644de9449d9a9b5 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 11 >> record.txt +echo echo 5a92722cbfd79d4f44b53d29c644de9449d9a9b5 to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "refactor: modify execute_cmd function,part 1" into rustdev" +echo git commit -m Merge "refactor: modify execute_cmd function,part 1" into rustdev ; +git push origin bv11 +echo git push origin bv11; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv12; +git checkout -b bv12; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 31346f4ffaae817b3242928f473619b7d06d94bd ; +echo git reset --hard 31346f4ffaae817b3242928f473619b7d06d94bd ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 12 >> record.txt +echo echo 31346f4ffaae817b3242928f473619b7d06d94bd to record.txt ; +git add .; +echo git add .; +git commit -m " 添加cd rust 源码,并优化指针判空写法" +echo git commit -m 添加cd rust 源码,并优化指针判空写法 ; +git push origin bv12 +echo git push origin bv12; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv13; +git checkout -b bv13; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 8370b614793b54261b1ef08bdeb0aa36eb8f01a2 ; +echo git reset --hard 8370b614793b54261b1ef08bdeb0aa36eb8f01a2 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 13 >> record.txt +echo echo 8370b614793b54261b1ef08bdeb0aa36eb8f01a2 to record.txt ; +git add .; +echo git add .; +git commit -m " 1 添加fc命令源码 2 优化代码规范,去掉多余的空格 3 添加注册函数" +echo git commit -m 1 添加fc命令源码 2 优化代码规范,去掉多余的空格 3 添加注册函数 ; +git push origin bv13 +echo git push origin bv13; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv14; +git checkout -b bv14; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard f86f4f2bf1290c6874e817b94ab3a5cdb767b12a ; +echo git reset --hard f86f4f2bf1290c6874e817b94ab3a5cdb767b12a ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 14 >> record.txt +echo echo f86f4f2bf1290c6874e817b94ab3a5cdb767b12a to record.txt ; +git add .; +echo git add .; +git commit -m " 1 添加getsopts 命令 rust 源码 2 优化二级指针偏移" +echo git commit -m 1 添加getsopts 命令 rust 源码 2 优化二级指针偏移 ; +git push origin bv14 +echo git push origin bv14; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv15; +git checkout -b bv15; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard ca56a5df9aec33adeb75143077d781d5a807593e ; +echo git reset --hard ca56a5df9aec33adeb75143077d781d5a807593e ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 15 >> record.txt +echo echo ca56a5df9aec33adeb75143077d781d5a807593e to record.txt ; +git add .; +echo git add .; +git commit -m " 1 添加source rust源码 2 纠正STREQN 的实现" +echo git commit -m 1 添加source rust源码 2 纠正STREQN 的实现 ; +git push origin bv15 +echo git push origin bv15; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv16; +git checkout -b bv16; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard ea1d13cf401ea9f93ebe5f4a232c828ed39ffb3b ; +echo git reset --hard ea1d13cf401ea9f93ebe5f4a232c828ed39ffb3b ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 16 >> record.txt +echo echo ea1d13cf401ea9f93ebe5f4a232c828ed39ffb3b to record.txt ; +git add .; +echo git add .; +git commit -m " builtins_rust: update read plugin" +echo git commit -m builtins_rust: update read plugin ; +git push origin bv16 +echo git push origin bv16; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv17; +git checkout -b bv17; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard ddff45d647b3214c0bbb0c2a26dfffbe1ab4d6e1 ; +echo git reset --hard ddff45d647b3214c0bbb0c2a26dfffbe1ab4d6e1 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 17 >> record.txt +echo echo ddff45d647b3214c0bbb0c2a26dfffbe1ab4d6e1 to record.txt ; +git add .; +echo git add .; +git commit -m " 1 declare 命令 rust 源码" +echo git commit -m 1 declare 命令 rust 源码 ; +git push origin bv17 +echo git push origin bv17; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv18; +git checkout -b bv18; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 7edb13a39895925afb2a0b1d3864470aeed94485 ; +echo git reset --hard 7edb13a39895925afb2a0b1d3864470aeed94485 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 18 >> record.txt +echo echo 7edb13a39895925afb2a0b1d3864470aeed94485 to record.txt ; +git add .; +echo git add .; +git commit -m " builtins_rust: add history plugin" +echo git commit -m builtins_rust: add history plugin ; +git push origin bv18 +echo git push origin bv18; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv19; +git checkout -b bv19; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard cb7247d1cf0deff99be280bc5675b1e3376fda6a ; +echo git reset --hard cb7247d1cf0deff99be280bc5675b1e3376fda6a ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 19 >> record.txt +echo echo cb7247d1cf0deff99be280bc5675b1e3376fda6a to record.txt ; +git add .; +echo git add .; +git commit -m " builtins_rust: add kill plugin" +echo git commit -m builtins_rust: add kill plugin ; +git push origin bv19 +echo git push origin bv19; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv20; +git checkout -b bv20; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard d89ed9d3662658da4ff61a5e98d4623f9c791598 ; +echo git reset --hard d89ed9d3662658da4ff61a5e98d4623f9c791598 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 20 >> record.txt +echo echo d89ed9d3662658da4ff61a5e98d4623f9c791598 to record.txt ; +git add .; +echo git add .; +git commit -m " 1 添加bash rust重构pushd 命令源码" +echo git commit -m 1 添加bash rust重构pushd 命令源码 ; +git push origin bv20 +echo git push origin bv20; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv21; +git checkout -b bv21; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard ecff8a6bde802a83b39715d2081706049bc403c8 ; +echo git reset --hard ecff8a6bde802a83b39715d2081706049bc403c8 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 21 >> record.txt +echo echo ecff8a6bde802a83b39715d2081706049bc403c8 to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "builtins_rust: add kill plugin" into rustdev" +echo git commit -m Merge "builtins_rust: add kill plugin" into rustdev ; +git push origin bv21 +echo git push origin bv21; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv22; +git checkout -b bv22; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 99fc02b24c9c7eb3afef7387233e5fddf9c6cf11 ; +echo git reset --hard 99fc02b24c9c7eb3afef7387233e5fddf9c6cf11 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 22 >> record.txt +echo echo 99fc02b24c9c7eb3afef7387233e5fddf9c6cf11 to record.txt ; +git add .; +echo git add .; +git commit -m " builtins_rust: add let plugin" +echo git commit -m builtins_rust: add let plugin ; +git push origin bv22 +echo git push origin bv22; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv23; +git checkout -b bv23; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard af476a9df7f9d589fcca6aa83ca9a57b39a2a8f6 ; +echo git reset --hard af476a9df7f9d589fcca6aa83ca9a57b39a2a8f6 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 23 >> record.txt +echo echo af476a9df7f9d589fcca6aa83ca9a57b39a2a8f6 to record.txt ; +git add .; +echo git add .; +git commit -m " builtins_rust: add mapfile plugin" +echo git commit -m builtins_rust: add mapfile plugin ; +git push origin bv23 +echo git push origin bv23; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv24; +git checkout -b bv24; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 39e06294409d398e050d328f3fd09eaf395087e9 ; +echo git reset --hard 39e06294409d398e050d328f3fd09eaf395087e9 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 24 >> record.txt +echo echo 39e06294409d398e050d328f3fd09eaf395087e9 to record.txt ; +git add .; +echo git add .; +git commit -m " 1 添加bash rust重构complete命令" +echo git commit -m 1 添加bash rust重构complete命令 ; +git push origin bv24 +echo git push origin bv24; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv25; +git checkout -b bv25; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 13af07fe9741f6b2db3c85ca4ead4b684fe1ba76 ; +echo git reset --hard 13af07fe9741f6b2db3c85ca4ead4b684fe1ba76 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 25 >> record.txt +echo echo 13af07fe9741f6b2db3c85ca4ead4b684fe1ba76 to record.txt ; +git add .; +echo git add .; +git commit -m " builtins_rust: add printf plugin" +echo git commit -m builtins_rust: add printf plugin ; +git push origin bv25 +echo git push origin bv25; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv26; +git checkout -b bv26; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 040c3852e88aced0f9bedf6ad35cf4ca24ba20b4 ; +echo git reset --hard 040c3852e88aced0f9bedf6ad35cf4ca24ba20b4 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 26 >> record.txt +echo echo 040c3852e88aced0f9bedf6ad35cf4ca24ba20b4 to record.txt ; +git add .; +echo git add .; +git commit -m " builtins_rust: add return plugin" +echo git commit -m builtins_rust: add return plugin ; +git push origin bv26 +echo git push origin bv26; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv27; +git checkout -b bv27; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard e7d0c3856c9b028da878a4f0fac38b3e828da2e5 ; +echo git reset --hard e7d0c3856c9b028da878a4f0fac38b3e828da2e5 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 27 >> record.txt +echo echo e7d0c3856c9b028da878a4f0fac38b3e828da2e5 to record.txt ; +git add .; +echo git add .; +git commit -m " builtins_rust: add shift plugin builtins_rust: add times plugin builtins_rust: add suspend plugin builtins_rust: add test plugin" +echo git commit -m builtins_rust: add shift plugin builtins_rust: add times plugin builtins_rust: add suspend plugin builtins_rust: add test plugin ; +git push origin bv27 +echo git push origin bv27; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv28; +git checkout -b bv28; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard caecab0a8c31785080b688f615abe40042ef3d81 ; +echo git reset --hard caecab0a8c31785080b688f615abe40042ef3d81 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 28 >> record.txt +echo echo caecab0a8c31785080b688f615abe40042ef3d81 to record.txt ; +git add .; +echo git add .; +git commit -m " rush: build with rust so" +echo git commit -m rush: build with rust so ; +git push origin bv28 +echo git push origin bv28; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv29; +git checkout -b bv29; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 5987ab26e969a62593146afaef3f6180fa566c42 ; +echo git reset --hard 5987ab26e969a62593146afaef3f6180fa566c42 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 29 >> record.txt +echo echo 5987ab26e969a62593146afaef3f6180fa566c42 to record.txt ; +git add .; +echo git add .; +git commit -m " rust: modify dylib to staticlib" +echo git commit -m rust: modify dylib to staticlib ; +git push origin bv29 +echo git push origin bv29; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv30; +git checkout -b bv30; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 0dc6bb5a20af927e7c0048dcb97b89ee878de9e2 ; +echo git reset --hard 0dc6bb5a20af927e7c0048dcb97b89ee878de9e2 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 30 >> record.txt +echo echo 0dc6bb5a20af927e7c0048dcb97b89ee878de9e2 to record.txt ; +git add .; +echo git add .; +git commit -m " rust: add colon and builtin" +echo git commit -m rust: add colon and builtin ; +git push origin bv30 +echo git push origin bv30; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv31; +git checkout -b bv31; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard f702f18ebda6077ab396597a807b742ff42f9718 ; +echo git reset --hard f702f18ebda6077ab396597a807b742ff42f9718 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 31 >> record.txt +echo echo f702f18ebda6077ab396597a807b742ff42f9718 to record.txt ; +git add .; +echo git add .; +git commit -m " builtins_rust: add trap plugin" +echo git commit -m builtins_rust: add trap plugin ; +git push origin bv31 +echo git push origin bv31; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv32; +git checkout -b bv32; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard c7d273a9a8614cd0b4cf9fe6ddddd1690df7f3a0 ; +echo git reset --hard c7d273a9a8614cd0b4cf9fe6ddddd1690df7f3a0 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 32 >> record.txt +echo echo c7d273a9a8614cd0b4cf9fe6ddddd1690df7f3a0 to record.txt ; +git add .; +echo git add .; +git commit -m " builtins_rust:add alias exit help" +echo git commit -m builtins_rust:add alias exit help ; +git push origin bv32 +echo git push origin bv32; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv33; +git checkout -b bv33; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard c9e34358dc4d3932d4f9a02f97493d622431fc11 ; +echo git reset --hard c9e34358dc4d3932d4f9a02f97493d622431fc11 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 33 >> record.txt +echo echo c9e34358dc4d3932d4f9a02f97493d622431fc11 to record.txt ; +git add .; +echo git add .; +git commit -m " rm doc" +echo git commit -m rm doc ; +git push origin bv33 +echo git push origin bv33; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv34; +git checkout -b bv34; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 925106ec5a9c695052d0ed4e96e7684f09d325e0 ; +echo git reset --hard 925106ec5a9c695052d0ed4e96e7684f09d325e0 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 34 >> record.txt +echo echo 925106ec5a9c695052d0ed4e96e7684f09d325e0 to record.txt ; +git add .; +echo git add .; +git commit -m " builtins_rust: add setattr plugin" +echo git commit -m builtins_rust: add setattr plugin ; +git push origin bv34 +echo git push origin bv34; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv35; +git checkout -b bv35; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 460e1f5130d8bb2a75d770296996fb35fa911592 ; +echo git reset --hard 460e1f5130d8bb2a75d770296996fb35fa911592 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 35 >> record.txt +echo echo 460e1f5130d8bb2a75d770296996fb35fa911592 to record.txt ; +git add .; +echo git add .; +git commit -m " add wait umask printf history eval caller bind alias" +echo git commit -m add wait umask printf history eval caller bind alias ; +git push origin bv35 +echo git push origin bv35; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv36; +git checkout -b bv36; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard fee860b67d05e315e66d3507480e4eb22cb4e2ca ; +echo git reset --hard fee860b67d05e315e66d3507480e4eb22cb4e2ca ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 36 >> record.txt +echo echo fee860b67d05e315e66d3507480e4eb22cb4e2ca to record.txt ; +git add .; +echo git add .; +git commit -m " add break ulimit type" +echo git commit -m add break ulimit type ; +git push origin bv36 +echo git push origin bv36; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv37; +git checkout -b bv37; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 38143b58456407750e4f0563dfcfebf27f641bd4 ; +echo git reset --hard 38143b58456407750e4f0563dfcfebf27f641bd4 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 37 >> record.txt +echo echo 38143b58456407750e4f0563dfcfebf27f641bd4 to record.txt ; +git add .; +echo git add .; +git commit -m " add exec and common, modify cd" +echo git commit -m add exec and common, modify cd ; +git push origin bv37 +echo git push origin bv37; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv38; +git checkout -b bv38; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard fd5373f3df3ce757400685b243c3d38e413312be ; +echo git reset --hard fd5373f3df3ce757400685b243c3d38e413312be ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 38 >> record.txt +echo echo fd5373f3df3ce757400685b243c3d38e413312be to record.txt ; +git add .; +echo git add .; +git commit -m " Refactoring code" +echo git commit -m Refactoring code ; +git push origin bv38 +echo git push origin bv38; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv39; +git checkout -b bv39; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 341c12df35c6343148d264c59f61661684f1555a ; +echo git reset --hard 341c12df35c6343148d264c59f61661684f1555a ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 39 >> record.txt +echo echo 341c12df35c6343148d264c59f61661684f1555a to record.txt ; +git add .; +echo git add .; +git commit -m " Refactoring code" +echo git commit -m Refactoring code ; +git push origin bv39 +echo git push origin bv39; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv40; +git checkout -b bv40; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 36dcb3a95e6d2ad7ba1b53796d6f1051002c42f0 ; +echo git reset --hard 36dcb3a95e6d2ad7ba1b53796d6f1051002c42f0 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 40 >> record.txt +echo echo 36dcb3a95e6d2ad7ba1b53796d6f1051002c42f0 to record.txt ; +git add .; +echo git add .; +git commit -m " double commit, cause error Revert "Refactoring code"" +echo git commit -m double commit, cause error Revert "Refactoring code" ; +git push origin bv40 +echo git push origin bv40; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv41; +git checkout -b bv41; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard f04d51713bffbeee31aee689b08fd0220c8ca75d ; +echo git reset --hard f04d51713bffbeee31aee689b08fd0220c8ca75d ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 41 >> record.txt +echo echo f04d51713bffbeee31aee689b08fd0220c8ca75d to record.txt ; +git add .; +echo git add .; +git commit -m " modify common" +echo git commit -m modify common ; +git push origin bv41 +echo git push origin bv41; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv42; +git checkout -b bv42; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 6466675c76bcbc771c5939410065d97ddda05ca4 ; +echo git reset --hard 6466675c76bcbc771c5939410065d97ddda05ca4 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 42 >> record.txt +echo echo 6466675c76bcbc771c5939410065d97ddda05ca4 to record.txt ; +git add .; +echo git add .; +git commit -m " add set command" +echo git commit -m add set command ; +git push origin bv42 +echo git push origin bv42; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv43; +git checkout -b bv43; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 554f7a914ed1a53c820a1e94d00726b3253d7903 ; +echo git reset --hard 554f7a914ed1a53c820a1e94d00726b3253d7903 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 43 >> record.txt +echo echo 554f7a914ed1a53c820a1e94d00726b3253d7903 to record.txt ; +git add .; +echo git add .; +git commit -m " fix compile error" +echo git commit -m fix compile error ; +git push origin bv43 +echo git push origin bv43; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv44; +git checkout -b bv44; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 411367dd7a0a2b40c7b921dd6c47dcf5e9059158 ; +echo git reset --hard 411367dd7a0a2b40c7b921dd6c47dcf5e9059158 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 44 >> record.txt +echo echo 411367dd7a0a2b40c7b921dd6c47dcf5e9059158 to record.txt ; +git add .; +echo git add .; +git commit -m " modify command.rs file" +echo git commit -m modify command.rs file ; +git push origin bv44 +echo git push origin bv44; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv45; +git checkout -b bv45; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 1fb55c5ecf5576943ba3643c2b76f8a04a5fe152 ; +echo git reset --hard 1fb55c5ecf5576943ba3643c2b76f8a04a5fe152 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 45 >> record.txt +echo echo 1fb55c5ecf5576943ba3643c2b76f8a04a5fe152 to record.txt ; +git add .; +echo git add .; +git commit -m " fix coredump" +echo git commit -m fix coredump ; +git push origin bv45 +echo git push origin bv45; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv46; +git checkout -b bv46; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 070aa64329ebfbdec61bd04e36f69cbbfcdbcd48 ; +echo git reset --hard 070aa64329ebfbdec61bd04e36f69cbbfcdbcd48 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 46 >> record.txt +echo echo 070aa64329ebfbdec61bd04e36f69cbbfcdbcd48 to record.txt ; +git add .; +echo git add .; +git commit -m " fix shopt setflag error" +echo git commit -m fix shopt setflag error ; +git push origin bv46 +echo git push origin bv46; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv47; +git checkout -b bv47; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard df7984f479c17805e976634718c63b5034cdd517 ; +echo git reset --hard df7984f479c17805e976634718c63b5034cdd517 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 47 >> record.txt +echo echo df7984f479c17805e976634718c63b5034cdd517 to record.txt ; +git add .; +echo git add .; +git commit -m " fix shopt error" +echo git commit -m fix shopt error ; +git push origin bv47 +echo git push origin bv47; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv48; +git checkout -b bv48; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 70b4faaf74e318d95e30c697592f84b571a0fe24 ; +echo git reset --hard 70b4faaf74e318d95e30c697592f84b571a0fe24 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 48 >> record.txt +echo echo 70b4faaf74e318d95e30c697592f84b571a0fe24 to record.txt ; +git add .; +echo git add .; +git commit -m " fix build error" +echo git commit -m fix build error ; +git push origin bv48 +echo git push origin bv48; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv49; +git checkout -b bv49; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 0e0395002a236f4e1c8397579b79954e0dc2a3f5 ; +echo git reset --hard 0e0395002a236f4e1c8397579b79954e0dc2a3f5 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 49 >> record.txt +echo echo 0e0395002a236f4e1c8397579b79954e0dc2a3f5 to record.txt ; +git add .; +echo git add .; +git commit -m " modify jobs" +echo git commit -m modify jobs ; +git push origin bv49 +echo git push origin bv49; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv50; +git checkout -b bv50; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 95a4108faf4b7093700e2d9abf43798fc8f1aa35 ; +echo git reset --hard 95a4108faf4b7093700e2d9abf43798fc8f1aa35 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 50 >> record.txt +echo echo 95a4108faf4b7093700e2d9abf43798fc8f1aa35 to record.txt ; +git add .; +echo git add .; +git commit -m " refact bind" +echo git commit -m refact bind ; +git push origin bv50 +echo git push origin bv50; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv51; +git checkout -b bv51; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 717301e3070467f19d156bc01c1b46c8aa6b9905 ; +echo git reset --hard 717301e3070467f19d156bc01c1b46c8aa6b9905 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 51 >> record.txt +echo echo 717301e3070467f19d156bc01c1b46c8aa6b9905 to record.txt ; +git add .; +echo git add .; +git commit -m " merge common from alias to eval" +echo git commit -m merge common from alias to eval ; +git push origin bv51 +echo git push origin bv51; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv52; +git checkout -b bv52; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard f045dbbd795ae6c0e35c694ce5bbc670e45e3cc0 ; +echo git reset --hard f045dbbd795ae6c0e35c694ce5bbc670e45e3cc0 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 52 >> record.txt +echo echo f045dbbd795ae6c0e35c694ce5bbc670e45e3cc0 to record.txt ; +git add .; +echo git add .; +git commit -m " refact exec exit" +echo git commit -m refact exec exit ; +git push origin bv52 +echo git push origin bv52; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv53; +git checkout -b bv53; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 82d6bb32c9bf058106dafec13d81fd61faeb01b3 ; +echo git reset --hard 82d6bb32c9bf058106dafec13d81fd61faeb01b3 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 53 >> record.txt +echo echo 82d6bb32c9bf058106dafec13d81fd61faeb01b3 to record.txt ; +git add .; +echo git add .; +git commit -m " check mapfile printf read suspend test time trap and merge refact common" +echo git commit -m check mapfile printf read suspend test time trap and merge refact common ; +git push origin bv53 +echo git push origin bv53; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv54; +git checkout -b bv54; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 10cd55321a7387a9ff00915920b884d5717372ae ; +echo git reset --hard 10cd55321a7387a9ff00915920b884d5717372ae ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 54 >> record.txt +echo echo 10cd55321a7387a9ff00915920b884d5717372ae to record.txt ; +git add .; +echo git add .; +git commit -m " Unified Interface parameter type and Implement factory patterns" +echo git commit -m Unified Interface parameter type and Implement factory patterns ; +git push origin bv54 +echo git push origin bv54; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv55; +git checkout -b bv55; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 9222a0d2cec8bfa43152b8a1da12b51046128068 ; +echo git reset --hard 9222a0d2cec8bfa43152b8a1da12b51046128068 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 55 >> record.txt +echo echo 9222a0d2cec8bfa43152b8a1da12b51046128068 to record.txt ; +git add .; +echo git add .; +git commit -m " fix history can not -d error" +echo git commit -m fix history can not -d error ; +git push origin bv55 +echo git push origin bv55; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv56; +git checkout -b bv56; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard e51b65d434a34e8cc56cb94b65acdc339020207c ; +echo git reset --hard e51b65d434a34e8cc56cb94b65acdc339020207c ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 56 >> record.txt +echo echo e51b65d434a34e8cc56cb94b65acdc339020207c to record.txt ; +git add .; +echo git add .; +git commit -m " modify read -t -d -e -n" +echo git commit -m modify read -t -d -e -n ; +git push origin bv56 +echo git push origin bv56; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv57; +git checkout -b bv57; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 724977750ec2acaf542bbec602e06c49d73a217c ; +echo git reset --hard 724977750ec2acaf542bbec602e06c49d73a217c ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 57 >> record.txt +echo echo 724977750ec2acaf542bbec602e06c49d73a217c to record.txt ; +git add .; +echo git add .; +git commit -m " use static mut var" +echo git commit -m use static mut var ; +git push origin bv57 +echo git push origin bv57; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv58; +git checkout -b bv58; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 79c007027d5a17e7c6a3183f6e7c0f38381bbb6b ; +echo git reset --hard 79c007027d5a17e7c6a3183f6e7c0f38381bbb6b ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 58 >> record.txt +echo echo 79c007027d5a17e7c6a3183f6e7c0f38381bbb6b to record.txt ; +git add .; +echo git add .; +git commit -m " succeed called factory" +echo git commit -m succeed called factory ; +git push origin bv58 +echo git push origin bv58; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv59; +git checkout -b bv59; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 0f7a654ee1022599fcb37478283b6734f83016ac ; +echo git reset --hard 0f7a654ee1022599fcb37478283b6734f83016ac ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 59 >> record.txt +echo echo 0f7a654ee1022599fcb37478283b6734f83016ac to record.txt ; +git add .; +echo git add .; +git commit -m " modify exec" +echo git commit -m modify exec ; +git push origin bv59 +echo git push origin bv59; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv60; +git checkout -b bv60; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard e7be711a2d3501268fe1db0171885580480894c7 ; +echo git reset --hard e7be711a2d3501268fe1db0171885580480894c7 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 60 >> record.txt +echo echo e7be711a2d3501268fe1db0171885580480894c7 to record.txt ; +git add .; +echo git add .; +git commit -m " fixed some command segmentation fault" +echo git commit -m fixed some command segmentation fault ; +git push origin bv60 +echo git push origin bv60; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv61; +git checkout -b bv61; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 5b352d9f227a436170d90cd861b576a27de649c4 ; +echo git reset --hard 5b352d9f227a436170d90cd861b576a27de649c4 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 61 >> record.txt +echo echo 5b352d9f227a436170d90cd861b576a27de649c4 to record.txt ; +git add .; +echo git add .; +git commit -m " fixed readonly and export cannot jump loop" +echo git commit -m fixed readonly and export cannot jump loop ; +git push origin bv61 +echo git push origin bv61; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv62; +git checkout -b bv62; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 552bc4a75c9b905a950c2ca699435452b65f9d45 ; +echo git reset --hard 552bc4a75c9b905a950c2ca699435452b65f9d45 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 62 >> record.txt +echo echo 552bc4a75c9b905a950c2ca699435452b65f9d45 to record.txt ; +git add .; +echo git add .; +git commit -m " fixed test suspend shift error" +echo git commit -m fixed test suspend shift error ; +git push origin bv62 +echo git push origin bv62; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv63; +git checkout -b bv63; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 5055706c68c1b5a574e8c345acde65b9c490306f ; +echo git reset --hard 5055706c68c1b5a574e8c345acde65b9c490306f ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 63 >> record.txt +echo echo 5055706c68c1b5a574e8c345acde65b9c490306f to record.txt ; +git add .; +echo git add .; +git commit -m " fixed source error" +echo git commit -m fixed source error ; +git push origin bv63 +echo git push origin bv63; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv64; +git checkout -b bv64; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard e361ba0cbb7a4f819b96ef05329cb9b63e3c7642 ; +echo git reset --hard e361ba0cbb7a4f819b96ef05329cb9b63e3c7642 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 64 >> record.txt +echo echo e361ba0cbb7a4f819b96ef05329cb9b63e3c7642 to record.txt ; +git add .; +echo git add .; +git commit -m " fixed cmd --help error" +echo git commit -m fixed cmd --help error ; +git push origin bv64 +echo git push origin bv64; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv65; +git checkout -b bv65; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard b10fbeaa6b641b3e83d3144fb6e0de0253be7ec1 ; +echo git reset --hard b10fbeaa6b641b3e83d3144fb6e0de0253be7ec1 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 65 >> record.txt +echo echo b10fbeaa6b641b3e83d3144fb6e0de0253be7ec1 to record.txt ; +git add .; +echo git add .; +git commit -m " add usage for ulimit" +echo git commit -m add usage for ulimit ; +git push origin bv65 +echo git push origin bv65; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv66; +git checkout -b bv66; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 97b2b53031602fe0a6ab639a2078a399d12f96d4 ; +echo git reset --hard 97b2b53031602fe0a6ab639a2078a399d12f96d4 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 66 >> record.txt +echo echo 97b2b53031602fe0a6ab639a2078a399d12f96d4 to record.txt ; +git add .; +echo git add .; +git commit -m " convert i8 to c_char" +echo git commit -m convert i8 to c_char ; +git push origin bv66 +echo git push origin bv66; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv67; +git checkout -b bv67; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard b92d42bd77ba782f7c5546c41278e1665f7783f5 ; +echo git reset --hard b92d42bd77ba782f7c5546c41278e1665f7783f5 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 67 >> record.txt +echo echo b92d42bd77ba782f7c5546c41278e1665f7783f5 to record.txt ; +git add .; +echo git add .; +git commit -m " git add cargo vendor files" +echo git commit -m git add cargo vendor files ; +git push origin bv67 +echo git push origin bv67; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv68; +git checkout -b bv68; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 1194dc2c7d5ca8f0ec096a25faccd066ae1c57bc ; +echo git reset --hard 1194dc2c7d5ca8f0ec096a25faccd066ae1c57bc ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 68 >> record.txt +echo echo 1194dc2c7d5ca8f0ec096a25faccd066ae1c57bc to record.txt ; +git add .; +echo git add .; +git commit -m " add translations file" +echo git commit -m add translations file ; +git push origin bv68 +echo git push origin bv68; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv69; +git checkout -b bv69; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard cb394fcaa843187d6d24ad5fe33998e78c6c9527 ; +echo git reset --hard cb394fcaa843187d6d24ad5fe33998e78c6c9527 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 69 >> record.txt +echo echo cb394fcaa843187d6d24ad5fe33998e78c6c9527 to record.txt ; +git add .; +echo git add .; +git commit -m " add translatins file 2" +echo git commit -m add translatins file 2 ; +git push origin bv69 +echo git push origin bv69; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv70; +git checkout -b bv70; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 038c321f2f28a1b8688c68c86974d912b38a5803 ; +echo git reset --hard 038c321f2f28a1b8688c68c86974d912b38a5803 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 70 >> record.txt +echo echo 038c321f2f28a1b8688c68c86974d912b38a5803 to record.txt ; +git add .; +echo git add .; +git commit -m " add translation file 3" +echo git commit -m add translation file 3 ; +git push origin bv70 +echo git push origin bv70; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv71; +git checkout -b bv71; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard f688c1d7c41fe6ae6d27f5b82251402bde322339 ; +echo git reset --hard f688c1d7c41fe6ae6d27f5b82251402bde322339 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 71 >> record.txt +echo echo f688c1d7c41fe6ae6d27f5b82251402bde322339 to record.txt ; +git add .; +echo git add .; +git commit -m " modify execute retrun error call read: factory:read->return" +echo git commit -m modify execute retrun error call read: factory:read->return ; +git push origin bv71 +echo git push origin bv71; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv72; +git checkout -b bv72; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 89b6ba202761304458c7faffc9ad1a7c5de0172f ; +echo git reset --hard 89b6ba202761304458c7faffc9ad1a7c5de0172f ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 72 >> record.txt +echo echo 89b6ba202761304458c7faffc9ad1a7c5de0172f to record.txt ; +git add .; +echo git add .; +git commit -m " remove print msg" +echo git commit -m remove print msg ; +git push origin bv72 +echo git push origin bv72; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv73; +git checkout -b bv73; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 8417230f57e8eaea155ab6809bf88c4ee91c0aff ; +echo git reset --hard 8417230f57e8eaea155ab6809bf88c4ee91c0aff ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 73 >> record.txt +echo echo 8417230f57e8eaea155ab6809bf88c4ee91c0aff to record.txt ; +git add .; +echo git add .; +git commit -m " sync from rpmbuild,remove doc and other file" +echo git commit -m sync from rpmbuild,remove doc and other file ; +git push origin bv73 +echo git push origin bv73; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv74; +git checkout -b bv74; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 3d84851489913216c57bad0a471725f167308cee ; +echo git reset --hard 3d84851489913216c57bad0a471725f167308cee ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 74 >> record.txt +echo echo 3d84851489913216c57bad0a471725f167308cee to record.txt ; +git add .; +echo git add .; +git commit -m " fix kill -l and trap -l" +echo git commit -m fix kill -l and trap -l ; +git push origin bv74 +echo git push origin bv74; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv75; +git checkout -b bv75; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 72069ebbbfd134eec710ab17660e4d67b9f307ac ; +echo git reset --hard 72069ebbbfd134eec710ab17660e4d67b9f307ac ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 75 >> record.txt +echo echo 72069ebbbfd134eec710ab17660e4d67b9f307ac to record.txt ; +git add .; +echo git add .; +git commit -m " modify transfile path" +echo git commit -m modify transfile path ; +git push origin bv75 +echo git push origin bv75; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv76; +git checkout -b bv76; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 1887d5377ba409fb3692805654de96165cc85161 ; +echo git reset --hard 1887d5377ba409fb3692805654de96165cc85161 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 76 >> record.txt +echo echo 1887d5377ba409fb3692805654de96165cc85161 to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "modify transfile path" into rustdev" +echo git commit -m Merge "modify transfile path" into rustdev ; +git push origin bv76 +echo git push origin bv76; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv77; +git checkout -b bv77; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 20b615f01c67efa857592872ce48134d2e9af5f2 ; +echo git reset --hard 20b615f01c67efa857592872ce48134d2e9af5f2 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 77 >> record.txt +echo echo 20b615f01c67efa857592872ce48134d2e9af5f2 to record.txt ; +git add .; +echo git add .; +git commit -m " fix: 160365 rash disown execute error without parameter" +echo git commit -m fix: 160365 rash disown execute error without parameter ; +git push origin bv77 +echo git push origin bv77; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv78; +git checkout -b bv78; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard e64650fdabf3b511d482b687399f5b0f50464a1d ; +echo git reset --hard e64650fdabf3b511d482b687399f5b0f50464a1d ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 78 >> record.txt +echo echo e64650fdabf3b511d482b687399f5b0f50464a1d to record.txt ; +git add .; +echo git add .; +git commit -m " realize some command translation" +echo git commit -m realize some command translation ; +git push origin bv78 +echo git push origin bv78; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv79; +git checkout -b bv79; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 0b339314d05ca826831e071b3405abe09c463765 ; +echo git reset --hard 0b339314d05ca826831e071b3405abe09c463765 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 79 >> record.txt +echo echo 0b339314d05ca826831e071b3405abe09c463765 to record.txt ; +git add .; +echo git add .; +git commit -m " change LANGUAGE to LANG" +echo git commit -m change LANGUAGE to LANG ; +git push origin bv79 +echo git push origin bv79; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv80; +git checkout -b bv80; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 42cc1a5b57a384c6f9028251078e72ed7a7beafd ; +echo git reset --hard 42cc1a5b57a384c6f9028251078e72ed7a7beafd ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 80 >> record.txt +echo echo 42cc1a5b57a384c6f9028251078e72ed7a7beafd to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "realize some command translation" into rustdev" +echo git commit -m Merge "realize some command translation" into rustdev ; +git push origin bv80 +echo git push origin bv80; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv81; +git checkout -b bv81; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard e890c4eb63ebcc754f1669b1445b448db96a4da9 ; +echo git reset --hard e890c4eb63ebcc754f1669b1445b448db96a4da9 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 81 >> record.txt +echo echo e890c4eb63ebcc754f1669b1445b448db96a4da9 to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "change LANGUAGE to LANG" into rustdev" +echo git commit -m Merge "change LANGUAGE to LANG" into rustdev ; +git push origin bv81 +echo git push origin bv81; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv82; +git checkout -b bv82; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard fe184ac9ef5882c2c4fffc0912bb7ab62ffaeb93 ; +echo git reset --hard fe184ac9ef5882c2c4fffc0912bb7ab62ffaeb93 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 82 >> record.txt +echo echo fe184ac9ef5882c2c4fffc0912bb7ab62ffaeb93 to record.txt ; +git add .; +echo git add .; +git commit -m " fix 160413 umask fmt error" +echo git commit -m fix 160413 umask fmt error ; +git push origin bv82 +echo git push origin bv82; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv83; +git checkout -b bv83; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard f1567e0f82b3ca20388da8d412e5957acf64d5b0 ; +echo git reset --hard f1567e0f82b3ca20388da8d412e5957acf64d5b0 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 83 >> record.txt +echo echo f1567e0f82b3ca20388da8d412e5957acf64d5b0 to record.txt ; +git add .; +echo git add .; +git commit -m " fixed help -m err" +echo git commit -m fixed help -m err ; +git push origin bv83 +echo git push origin bv83; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv84; +git checkout -b bv84; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard a545f8fd3b81d3e6b19b4a868f1d8ee0d2e5ed73 ; +echo git reset --hard a545f8fd3b81d3e6b19b4a868f1d8ee0d2e5ed73 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 84 >> record.txt +echo echo a545f8fd3b81d3e6b19b4a868f1d8ee0d2e5ed73 to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "fix 160413 umask fmt error" into rustdev" +echo git commit -m Merge "fix 160413 umask fmt error" into rustdev ; +git push origin bv84 +echo git push origin bv84; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv85; +git checkout -b bv85; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 2d8cdcf350720956b0fda3c64f93d013d2ee17e2 ; +echo git reset --hard 2d8cdcf350720956b0fda3c64f93d013d2ee17e2 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 85 >> record.txt +echo echo 2d8cdcf350720956b0fda3c64f93d013d2ee17e2 to record.txt ; +git add .; +echo git add .; +git commit -m " fix :160145 alias fmt error" +echo git commit -m fix :160145 alias fmt error ; +git push origin bv85 +echo git push origin bv85; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv86; +git checkout -b bv86; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 06ca889c4860d1e4e25d2dce77d991d11919a307 ; +echo git reset --hard 06ca889c4860d1e4e25d2dce77d991d11919a307 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 86 >> record.txt +echo echo 06ca889c4860d1e4e25d2dce77d991d11919a307 to record.txt ; +git add .; +echo git add .; +git commit -m " fix: disown -r option error" +echo git commit -m fix: disown -r option error ; +git push origin bv86 +echo git push origin bv86; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv87; +git checkout -b bv87; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard c750605cf5c673b50183671f79858ae154c407a0 ; +echo git reset --hard c750605cf5c673b50183671f79858ae154c407a0 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 87 >> record.txt +echo echo c750605cf5c673b50183671f79858ae154c407a0 to record.txt ; +git add .; +echo git add .; +git commit -m " change opt variant to mut" +echo git commit -m change opt variant to mut ; +git push origin bv87 +echo git push origin bv87; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv88; +git checkout -b bv88; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 808801d81756188f841510017dbaeace519da23c ; +echo git reset --hard 808801d81756188f841510017dbaeace519da23c ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 88 >> record.txt +echo echo 808801d81756188f841510017dbaeace519da23c to record.txt ; +git add .; +echo git add .; +git commit -m " fix fc command" +echo git commit -m fix fc command ; +git push origin bv88 +echo git push origin bv88; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv89; +git checkout -b bv89; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 68e37bbcc3d58e84df4b4854f69d0673f7cc7d58 ; +echo git reset --hard 68e37bbcc3d58e84df4b4854f69d0673f7cc7d58 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 89 >> record.txt +echo echo 68e37bbcc3d58e84df4b4854f69d0673f7cc7d58 to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "fix fc command" into rustdev" +echo git commit -m Merge "fix fc command" into rustdev ; +git push origin bv89 +echo git push origin bv89; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv90; +git checkout -b bv90; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 8e0d9c53896edd0eb62c6e0ba4e424c1fc925230 ; +echo git reset --hard 8e0d9c53896edd0eb62c6e0ba4e424c1fc925230 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 90 >> record.txt +echo echo 8e0d9c53896edd0eb62c6e0ba4e424c1fc925230 to record.txt ; +git add .; +echo git add .; +git commit -m " realize translation command --help" +echo git commit -m realize translation command --help ; +git push origin bv90 +echo git push origin bv90; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv91; +git checkout -b bv91; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 7c1d6e6eaaa602936c960663bacaf80e3dcf3965 ; +echo git reset --hard 7c1d6e6eaaa602936c960663bacaf80e3dcf3965 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 91 >> record.txt +echo echo 7c1d6e6eaaa602936c960663bacaf80e3dcf3965 to record.txt ; +git add .; +echo git add .; +git commit -m " fix pushd -l, popd -l, dirs command" +echo git commit -m fix pushd -l, popd -l, dirs command ; +git push origin bv91 +echo git push origin bv91; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv92; +git checkout -b bv92; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 5dc4c4767ea225b5270f998a9cb06bd2b368118c ; +echo git reset --hard 5dc4c4767ea225b5270f998a9cb06bd2b368118c ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 92 >> record.txt +echo echo 5dc4c4767ea225b5270f998a9cb06bd2b368118c to record.txt ; +git add .; +echo git add .; +git commit -m " fixed declare -i err" +echo git commit -m fixed declare -i err ; +git push origin bv92 +echo git push origin bv92; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv93; +git checkout -b bv93; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 972471884b58c115f9c611a84107aa938c058a32 ; +echo git reset --hard 972471884b58c115f9c611a84107aa938c058a32 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 93 >> record.txt +echo echo 972471884b58c115f9c611a84107aa938c058a32 to record.txt ; +git add .; +echo git add .; +git commit -m " fixed declare error" +echo git commit -m fixed declare error ; +git push origin bv93 +echo git push origin bv93; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv94; +git checkout -b bv94; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 102dae472a96e7c811f5e99b3c756887da4253a4 ; +echo git reset --hard 102dae472a96e7c811f5e99b3c756887da4253a4 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 94 >> record.txt +echo echo 102dae472a96e7c811f5e99b3c756887da4253a4 to record.txt ; +git add .; +echo git add .; +git commit -m " fix typeseterror:exec_cmd: typeset to declare" +echo git commit -m fix typeseterror:exec_cmd: typeset to declare ; +git push origin bv94 +echo git push origin bv94; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv95; +git checkout -b bv95; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 06d456ee7b52becc2e77875c9a0a5d4308bd1828 ; +echo git reset --hard 06d456ee7b52becc2e77875c9a0a5d4308bd1828 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 95 >> record.txt +echo echo 06d456ee7b52becc2e77875c9a0a5d4308bd1828 to record.txt ; +git add .; +echo git add .; +git commit -m " change help longdoc format" +echo git commit -m change help longdoc format ; +git push origin bv95 +echo git push origin bv95; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv96; +git checkout -b bv96; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 1d30a26ae0817569e83d69e84a08e7999dbecc68 ; +echo git reset --hard 1d30a26ae0817569e83d69e84a08e7999dbecc68 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 96 >> record.txt +echo echo 1d30a26ae0817569e83d69e84a08e7999dbecc68 to record.txt ; +git add .; +echo git add .; +git commit -m " modify project name rash->utshell" +echo git commit -m modify project name rash->utshell ; +git push origin bv96 +echo git push origin bv96; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv97; +git checkout -b bv97; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard d0537a70467845b4caf25863006bbd142c2241dd ; +echo git reset --hard d0537a70467845b4caf25863006bbd142c2241dd ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 97 >> record.txt +echo echo d0537a70467845b4caf25863006bbd142c2241dd to record.txt ; +git add .; +echo git add .; +git commit -m " fixed declare -p error" +echo git commit -m fixed declare -p error ; +git push origin bv97 +echo git push origin bv97; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv98; +git checkout -b bv98; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard fb327d67a0e9cad54228b940a895d4d1c9ab5ad0 ; +echo git reset --hard fb327d67a0e9cad54228b940a895d4d1c9ab5ad0 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 98 >> record.txt +echo echo fb327d67a0e9cad54228b940a895d4d1c9ab5ad0 to record.txt ; +git add .; +echo git add .; +git commit -m " chage ptr move as offset" +echo git commit -m chage ptr move as offset ; +git push origin bv98 +echo git push origin bv98; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv99; +git checkout -b bv99; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard a06caded61b6a43bb89159be04a0eb9af738e711 ; +echo git reset --hard a06caded61b6a43bb89159be04a0eb9af738e711 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 99 >> record.txt +echo echo a06caded61b6a43bb89159be04a0eb9af738e711 to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "fix pushd -l, popd -l, dirs command" into rustdev" +echo git commit -m Merge "fix pushd -l, popd -l, dirs command" into rustdev ; +git push origin bv99 +echo git push origin bv99; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv100; +git checkout -b bv100; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 13556a85f76698547e08c7fa46b8a88301dc73a5 ; +echo git reset --hard 13556a85f76698547e08c7fa46b8a88301dc73a5 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 100 >> record.txt +echo echo 13556a85f76698547e08c7fa46b8a88301dc73a5 to record.txt ; +git add .; +echo git add .; +git commit -m " fixed ulimit cmd print format err" +echo git commit -m fixed ulimit cmd print format err ; +git push origin bv100 +echo git push origin bv100; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv101; +git checkout -b bv101; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard e76865581185412bd15fb89ef5e7e36258212150 ; +echo git reset --hard e76865581185412bd15fb89ef5e7e36258212150 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 101 >> record.txt +echo echo e76865581185412bd15fb89ef5e7e36258212150 to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "fixed ulimit cmd print format err" into rustdev" +echo git commit -m Merge "fixed ulimit cmd print format err" into rustdev ; +git push origin bv101 +echo git push origin bv101; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv102; +git checkout -b bv102; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard d9ed5098a46ac6bcd9addc2c1e97a3195ac022bd ; +echo git reset --hard d9ed5098a46ac6bcd9addc2c1e97a3195ac022bd ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 102 >> record.txt +echo echo d9ed5098a46ac6bcd9addc2c1e97a3195ac022bd to record.txt ; +git add .; +echo git add .; +git commit -m " fix printf %f" +echo git commit -m fix printf %f ; +git push origin bv102 +echo git push origin bv102; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv103; +git checkout -b bv103; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard ad9027e057c5a227be8159b9a6eb31d5e8641309 ; +echo git reset --hard ad9027e057c5a227be8159b9a6eb31d5e8641309 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 103 >> record.txt +echo echo ad9027e057c5a227be8159b9a6eb31d5e8641309 to record.txt ; +git add .; +echo git add .; +git commit -m " change en-US translztion format" +echo git commit -m change en-US translztion format ; +git push origin bv103 +echo git push origin bv103; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv104; +git checkout -b bv104; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 204c0925c7d148257a8d6102e82e4e8dccf53cb3 ; +echo git reset --hard 204c0925c7d148257a8d6102e82e4e8dccf53cb3 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 104 >> record.txt +echo echo 204c0925c7d148257a8d6102e82e4e8dccf53cb3 to record.txt ; +git add .; +echo git add .; +git commit -m " fixed declare -a err" +echo git commit -m fixed declare -a err ; +git push origin bv104 +echo git push origin bv104; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv105; +git checkout -b bv105; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard fea9649b3799f2e6de35ebca49b4c771f73d1c92 ; +echo git reset --hard fea9649b3799f2e6de35ebca49b4c771f73d1c92 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 105 >> record.txt +echo echo fea9649b3799f2e6de35ebca49b4c771f73d1c92 to record.txt ; +git add .; +echo git add .; +git commit -m " fix type -a" +echo git commit -m fix type -a ; +git push origin bv105 +echo git push origin bv105; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv106; +git checkout -b bv106; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 690d56a0f3209fdd4559d855674e78d8107920b8 ; +echo git reset --hard 690d56a0f3209fdd4559d855674e78d8107920b8 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 106 >> record.txt +echo echo 690d56a0f3209fdd4559d855674e78d8107920b8 to record.txt ; +git add .; +echo git add .; +git commit -m " fix enable -a" +echo git commit -m fix enable -a ; +git push origin bv106 +echo git push origin bv106; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv107; +git checkout -b bv107; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 3788e0451fcd072fabf44cf96de23d723676c13b ; +echo git reset --hard 3788e0451fcd072fabf44cf96de23d723676c13b ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 107 >> record.txt +echo echo 3788e0451fcd072fabf44cf96de23d723676c13b to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "change en-US translztion format" into rustdev" +echo git commit -m Merge "change en-US translztion format" into rustdev ; +git push origin bv107 +echo git push origin bv107; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv108; +git checkout -b bv108; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard e5b99f66029850a11f429c19fce3f614368a2748 ; +echo git reset --hard e5b99f66029850a11f429c19fce3f614368a2748 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 108 >> record.txt +echo echo e5b99f66029850a11f429c19fce3f614368a2748 to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "fix enable -a" into rustdev" +echo git commit -m Merge "fix enable -a" into rustdev ; +git push origin bv108 +echo git push origin bv108; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv109; +git checkout -b bv109; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard da17d91645784496a5edcdde6f882389397127e1 ; +echo git reset --hard da17d91645784496a5edcdde6f882389397127e1 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 109 >> record.txt +echo echo da17d91645784496a5edcdde6f882389397127e1 to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "fixed declare -a err" into rustdev" +echo git commit -m Merge "fixed declare -a err" into rustdev ; +git push origin bv109 +echo git push origin bv109; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv110; +git checkout -b bv110; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard af506d1a9f0e9542545f613db3c06887929d6d12 ; +echo git reset --hard af506d1a9f0e9542545f613db3c06887929d6d12 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 110 >> record.txt +echo echo af506d1a9f0e9542545f613db3c06887929d6d12 to record.txt ; +git add .; +echo git add .; +git commit -m " fix typeset -f function" +echo git commit -m fix typeset -f function ; +git push origin bv110 +echo git push origin bv110; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv111; +git checkout -b bv111; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 90a00b5509b085d1439800dff068bd96a26d277a ; +echo git reset --hard 90a00b5509b085d1439800dff068bd96a26d277a ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 111 >> record.txt +echo echo 90a00b5509b085d1439800dff068bd96a26d277a to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "fix typeset -f function" into rustdev" +echo git commit -m Merge "fix typeset -f function" into rustdev ; +git push origin bv111 +echo git push origin bv111; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv112; +git checkout -b bv112; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 3b850c3821bdc84882ef7ed8b779555e179afd25 ; +echo git reset --hard 3b850c3821bdc84882ef7ed8b779555e179afd25 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 112 >> record.txt +echo echo 3b850c3821bdc84882ef7ed8b779555e179afd25 to record.txt ; +git add .; +echo git add .; +git commit -m " add traslations for type" +echo git commit -m add traslations for type ; +git push origin bv112 +echo git push origin bv112; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv113; +git checkout -b bv113; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard ada589369c646185763a8c5253df5955a77e5d61 ; +echo git reset --hard ada589369c646185763a8c5253df5955a77e5d61 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 113 >> record.txt +echo echo ada589369c646185763a8c5253df5955a77e5d61 to record.txt ; +git add .; +echo git add .; +git commit -m " fix complete and compgen bug" +echo git commit -m fix complete and compgen bug ; +git push origin bv113 +echo git push origin bv113; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv114; +git checkout -b bv114; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard eab505fb31093598e39e6e7d3e39448e279923f2 ; +echo git reset --hard eab505fb31093598e39e6e7d3e39448e279923f2 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 114 >> record.txt +echo echo eab505fb31093598e39e6e7d3e39448e279923f2 to record.txt ; +git add .; +echo git add .; +git commit -m " fix memery err" +echo git commit -m fix memery err ; +git push origin bv114 +echo git push origin bv114; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv115; +git checkout -b bv115; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard f49cd3a3cbdb079d4f9aa09b178f6024dabca168 ; +echo git reset --hard f49cd3a3cbdb079d4f9aa09b178f6024dabca168 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 115 >> record.txt +echo echo f49cd3a3cbdb079d4f9aa09b178f6024dabca168 to record.txt ; +git add .; +echo git add .; +git commit -m " fix enable -n" +echo git commit -m fix enable -n ; +git push origin bv115 +echo git push origin bv115; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv116; +git checkout -b bv116; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard aedfa436429724000dfdbc042e5ec6cf149b5fc3 ; +echo git reset --hard aedfa436429724000dfdbc042e5ec6cf149b5fc3 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 116 >> record.txt +echo echo aedfa436429724000dfdbc042e5ec6cf149b5fc3 to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "fix enable -n" into rustdev" +echo git commit -m Merge "fix enable -n" into rustdev ; +git push origin bv116 +echo git push origin bv116; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv117; +git checkout -b bv117; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 3ba426b53b2c4bf27c12eb98c4de176df471c46d ; +echo git reset --hard 3ba426b53b2c4bf27c12eb98c4de176df471c46d ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 117 >> record.txt +echo echo 3ba426b53b2c4bf27c12eb98c4de176df471c46d to record.txt ; +git add .; +echo git add .; +git commit -m " add translation for let kill bind" +echo git commit -m add translation for let kill bind ; +git push origin bv117 +echo git push origin bv117; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv118; +git checkout -b bv118; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 77228f3e3692f3aae400c6ad37d795fe3fe24bf2 ; +echo git reset --hard 77228f3e3692f3aae400c6ad37d795fe3fe24bf2 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 118 >> record.txt +echo echo 77228f3e3692f3aae400c6ad37d795fe3fe24bf2 to record.txt ; +git add .; +echo git add .; +git commit -m " changed function location" +echo git commit -m changed function location ; +git push origin bv118 +echo git push origin bv118; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv119; +git checkout -b bv119; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 87f5bc0f673ea1d7ceb8de404a3fd3621b4c17ff ; +echo git reset --hard 87f5bc0f673ea1d7ceb8de404a3fd3621b4c17ff ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 119 >> record.txt +echo echo 87f5bc0f673ea1d7ceb8de404a3fd3621b4c17ff to record.txt ; +git add .; +echo git add .; +git commit -m " modify enable -n commind" +echo git commit -m modify enable -n commind ; +git push origin bv119 +echo git push origin bv119; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv120; +git checkout -b bv120; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 9b92233e6e928cb06a7c13d57aa15e0185bd3791 ; +echo git reset --hard 9b92233e6e928cb06a7c13d57aa15e0185bd3791 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 120 >> record.txt +echo echo 9b92233e6e928cb06a7c13d57aa15e0185bd3791 to record.txt ; +git add .; +echo git add .; +git commit -m " fix mapfile -d" +echo git commit -m fix mapfile -d ; +git push origin bv120 +echo git push origin bv120; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv121; +git checkout -b bv121; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 2e2ae9165d48c3b7dd2e1a6cb86fd035591060cf ; +echo git reset --hard 2e2ae9165d48c3b7dd2e1a6cb86fd035591060cf ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 121 >> record.txt +echo echo 2e2ae9165d48c3b7dd2e1a6cb86fd035591060cf to record.txt ; +git add .; +echo git add .; +git commit -m " add safe protocol for alias and hash" +echo git commit -m add safe protocol for alias and hash ; +git push origin bv121 +echo git push origin bv121; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv122; +git checkout -b bv122; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard eb8b0dd7ddd7e11f78b6528ea50925b04eb3ab7d ; +echo git reset --hard eb8b0dd7ddd7e11f78b6528ea50925b04eb3ab7d ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 122 >> record.txt +echo echo eb8b0dd7ddd7e11f78b6528ea50925b04eb3ab7d to record.txt ; +git add .; +echo git add .; +git commit -m " add u_src dir" +echo git commit -m add u_src dir ; +git push origin bv122 +echo git push origin bv122; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv123; +git checkout -b bv123; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 6d72fd0a3ccc1063c57467015616ee923d2ff7e2 ; +echo git reset --hard 6d72fd0a3ccc1063c57467015616ee923d2ff7e2 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 123 >> record.txt +echo echo 6d72fd0a3ccc1063c57467015616ee923d2ff7e2 to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "add safe protocol for alias and hash" into rustdev" +echo git commit -m Merge "add safe protocol for alias and hash" into rustdev ; +git push origin bv123 +echo git push origin bv123; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv124; +git checkout -b bv124; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard ac5c53099a6515a85e977ccf9afbf4e35c46a5ad ; +echo git reset --hard ac5c53099a6515a85e977ccf9afbf4e35c46a5ad ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 124 >> record.txt +echo echo ac5c53099a6515a85e977ccf9afbf4e35c46a5ad to record.txt ; +git add .; +echo git add .; +git commit -m " change translate file" +echo git commit -m change translate file ; +git push origin bv124 +echo git push origin bv124; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv125; +git checkout -b bv125; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard bc1080dd99fbc11c1f3c80131c776878523c30c2 ; +echo git reset --hard bc1080dd99fbc11c1f3c80131c776878523c30c2 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 125 >> record.txt +echo echo bc1080dd99fbc11c1f3c80131c776878523c30c2 to record.txt ; +git add .; +echo git add .; +git commit -m " fix:193533 utshell环境,Ctrl+D退出会话时,提示exit_builtin" +echo git commit -m fix:193533 utshell环境,Ctrl+D退出会话时,提示exit_builtin ; +git push origin bv125 +echo git push origin bv125; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv126; +git checkout -b bv126; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 1a86263c1c045c8c0bf59faa61de8897ba71082e ; +echo git reset --hard 1a86263c1c045c8c0bf59faa61de8897ba71082e ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 126 >> record.txt +echo echo 1a86263c1c045c8c0bf59faa61de8897ba71082e to record.txt ; +git add .; +echo git add .; +git commit -m " fix:193535.history -p mount和用例中预期不符" +echo git commit -m fix:193535.history -p mount和用例中预期不符 ; +git push origin bv126 +echo git push origin bv126; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv127; +git checkout -b bv127; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 5e7f126369b7c5be332ea82cae8534f4499b3a90 ; +echo git reset --hard 5e7f126369b7c5be332ea82cae8534f4499b3a90 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 127 >> record.txt +echo echo 5e7f126369b7c5be332ea82cae8534f4499b3a90 to record.txt ; +git add .; +echo git add .; +git commit -m " fix:193581 utshell环境,未执行kill -CONT 恢复进程时,执行ctrl+C无法结束wait -f 进程" +echo git commit -m fix:193581 utshell环境,未执行kill -CONT 恢复进程时,执行ctrl+C无法结束wait -f 进程 ; +git push origin bv127 +echo git push origin bv127; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv128; +git checkout -b bv128; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 97c737d22ff3adf518655aa848b6531a548b7779 ; +echo git reset --hard 97c737d22ff3adf518655aa848b6531a548b7779 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 128 >> record.txt +echo echo 97c737d22ff3adf518655aa848b6531a548b7779 to record.txt ; +git add .; +echo git add .; +git commit -m " fixed 193557 declare 命令变量输出异常,和用例中预期不一致" +echo git commit -m fixed 193557 declare 命令变量输出异常,和用例中预期不一致 ; +git push origin bv128 +echo git push origin bv128; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv129; +git checkout -b bv129; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 7e07d17473de10c94e37a2fddb63c39c00702be2 ; +echo git reset --hard 7e07d17473de10c94e37a2fddb63c39c00702be2 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 129 >> record.txt +echo echo 7e07d17473de10c94e37a2fddb63c39c00702be2 to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "fixed 193557 declare 命令变量输出异常,和用例中预期不一致" into rustdev" +echo git commit -m Merge "fixed 193557 declare 命令变量输出异常,和用例中预期不一致" into rustdev ; +git push origin bv129 +echo git push origin bv129; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv130; +git checkout -b bv130; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard f9f38431efe992eb9e7a0928968303643a6f0807 ; +echo git reset --hard f9f38431efe992eb9e7a0928968303643a6f0807 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 130 >> record.txt +echo echo f9f38431efe992eb9e7a0928968303643a6f0807 to record.txt ; +git add .; +echo git add .; +git commit -m " fixed declare command brackets's format" +echo git commit -m fixed declare command brackets's format ; +git push origin bv130 +echo git push origin bv130; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv131; +git checkout -b bv131; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 6cad4846183d77119319c2236c5c337e8f632c9a ; +echo git reset --hard 6cad4846183d77119319c2236c5c337e8f632c9a ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 131 >> record.txt +echo echo 6cad4846183d77119319c2236c5c337e8f632c9a to record.txt ; +git add .; +echo git add .; +git commit -m " Merge "fixed declare command brackets's format" into rustdev" +echo git commit -m Merge "fixed declare command brackets's format" into rustdev ; +git push origin bv131 +echo git push origin bv131; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv132; +git checkout -b bv132; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 7cf4c921dd95788697bd1f0ec49b6d918359b410 ; +echo git reset --hard 7cf4c921dd95788697bd1f0ec49b6d918359b410 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 132 >> record.txt +echo echo 7cf4c921dd95788697bd1f0ec49b6d918359b410 to record.txt ; +git add .; +echo git add .; +git commit -m " add print_cmd reconstruction" +echo git commit -m add print_cmd reconstruction ; +git push origin bv132 +echo git push origin bv132; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv133; +git checkout -b bv133; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard c74756216fafb31404717cacfef813637b43d1f3 ; +echo git reset --hard c74756216fafb31404717cacfef813637b43d1f3 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 133 >> record.txt +echo echo c74756216fafb31404717cacfef813637b43d1f3 to record.txt ; +git add .; +echo git add .; +git commit -m " delete command_h.re test" +echo git commit -m delete command_h.re test ; +git push origin bv133 +echo git push origin bv133; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv134; +git checkout -b bv134; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard a9f5a77741d8d425cadab98626379c37045958e3 ; +echo git reset --hard a9f5a77741d8d425cadab98626379c37045958e3 ; +cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash//* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 134 >> record.txt +echo echo a9f5a77741d8d425cadab98626379c37045958e3 to record.txt ; +git add .; +echo git add .; +git commit -m " generate header.rs from .h header files" +echo git commit -m generate header.rs from .h header files ; +git push origin bv134 +echo git push origin bv134; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read diff --git a/gen.sh b/gen.sh old mode 100644 new mode 100755 index 51b37028..05e9ffe9 --- a/gen.sh +++ b/gen.sh @@ -1,8 +1,9 @@ -export utshell_dir=/home/tong/src/bash; -export euler_dir=/home/tong/src/openeuler/utshell; +export utshell_dir=/home/huan/gerrit/bash; +export euler_dir=/home/huan/gerrit/utshell; export count=0`tail -1 ${euler_dir}/record.txt`; echo $euler_dir echo $utshell_dir +echo $count while read line ; do let count=count+1; echo $line|awk -F'$' '{ @@ -14,8 +15,8 @@ print "cd " ENVIRON["utshell_dir"] ";"; print "echo cd " ENVIRON["utshell_dir"] ";"; print "git reset --hard ",$1," ; "; print "echo git reset --hard ",$1," ; "; -print "cp -r " ENVIRON["utshell_dir"] "//* " ENVIRON["euler_dir"] ";" -print "echo cp -r " ENVIRON["utshell_dir"] "//* " ENVIRON["euler_dir"] ";" +print "cp -r " ENVIRON["utshell_dir"] "/* " ENVIRON["euler_dir"] ";" +print "echo cp -r " ENVIRON["utshell_dir"] "/* " ENVIRON["euler_dir"] ";" print "cd " ENVIRON["euler_dir"]; print "echo cd " ENVIRON["euler_dir"] ";" print "echo " ENVIRON["count"] " >> record.txt"; @@ -29,4 +30,4 @@ print "echo git push origin bv" ENVIRON["count"] ";"; print "cd " ENVIRON["utshell_dir"]; print "echo cd " ENVIRON["utshell_dir"] ";" print "read "; -}' ; done < ../1 >./x.sh +}' ; done < 1 > x.sh diff --git a/record.txt b/record.txt index 8e435da9..397c583f 100644 --- a/record.txt +++ b/record.txt @@ -11,3 +11,4 @@ 11 12 13 +12 diff --git a/x.sh b/x.sh old mode 100644 new mode 100755 index ea40c218..28d90989 --- a/x.sh +++ b/x.sh @@ -1,230 +1,184 @@ -echo cd /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell; -echo git checkout -b bv4; -git checkout -b bv4; -cd /home/tong/src/bash; -echo cd /home/tong/src/bash; +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv12; +git checkout -b bv12; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 4e5ff3911664c3535659c83e05c05d6d809e57d5 ; +echo git reset --hard 4e5ff3911664c3535659c83e05c05d6d809e57d5 ; +cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 12 >> record.txt +echo echo 4e5ff3911664c3535659c83e05c05d6d809e57d5 to record.txt ; +git add .; +echo git add .; +git commit -m " add README821d31e4f75848ca30bf5b5bede06256907b09f0 " +echo git commit -m add README821d31e4f75848ca30bf5b5bede06256907b09f0 ; +git push origin bv12 +echo git push origin bv12; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv13; +git checkout -b bv13; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard d8b5fe4e7673b03007c243172537bc84b7d7c558 ; +echo git reset --hard d8b5fe4e7673b03007c243172537bc84b7d7c558 ; +cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 13 >> record.txt +echo echo d8b5fe4e7673b03007c243172537bc84b7d7c558 to record.txt ; +git add .; +echo git add .; +git commit -m " refactor: add rust framework for builtins." +echo git commit -m refactor: add rust framework for builtins. ; +git push origin bv13 +echo git push origin bv13; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv14; +git checkout -b bv14; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; +git reset --hard 9edf0cde85de2eb55837061e75b2cf882cc11e55 ; +echo git reset --hard 9edf0cde85de2eb55837061e75b2cf882cc11e55 ; +cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 14 >> record.txt +echo echo 9edf0cde85de2eb55837061e75b2cf882cc11e55 to record.txt ; +git add .; +echo git add .; +git commit -m " refactor: move builtins_org to builtins" +echo git commit -m refactor: move builtins_org to builtins ; +git push origin bv14 +echo git push origin bv14; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; +read +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv15; +git checkout -b bv15; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; git reset --hard d337102476240db1552c114113fb8316a0b9770f ; echo git reset --hard d337102476240db1552c114113fb8316a0b9770f ; -cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -echo cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell -echo cd /home/tong/src/openeuler/utshell; -echo 4 >> record.txt +cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 15 >> record.txt echo echo d337102476240db1552c114113fb8316a0b9770f to record.txt ; git add .; echo git add .; git commit -m " 添加jobs rust code" echo git commit -m 添加jobs rust code ; -git push origin bv4 -echo git push origin bv4; -cd /home/tong/src/bash -echo cd /home/tong/src/bash; +git push origin bv15 +echo git push origin bv15; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; read -echo cd /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell; -echo git checkout -b bv5; -git checkout -b bv5; -cd /home/tong/src/bash; -echo cd /home/tong/src/bash; +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv16; +git checkout -b bv16; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; git reset --hard 59f05227deab020a56c870c2b7792104413ad4c7 ; echo git reset --hard 59f05227deab020a56c870c2b7792104413ad4c7 ; -cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -echo cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell -echo cd /home/tong/src/openeuler/utshell; -echo 5 >> record.txt +cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 16 >> record.txt echo echo 59f05227deab020a56c870c2b7792104413ad4c7 to record.txt ; git add .; echo git add .; git commit -m " builtins_rust: add read plugin" echo git commit -m builtins_rust: add read plugin ; -git push origin bv5 -echo git push origin bv5; -cd /home/tong/src/bash -echo cd /home/tong/src/bash; +git push origin bv16 +echo git push origin bv16; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; read -echo cd /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell; -echo git checkout -b bv6; -git checkout -b bv6; -cd /home/tong/src/bash; -echo cd /home/tong/src/bash; +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv17; +git checkout -b bv17; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; git reset --hard b33fe3ce7039944a5a18aefcc51c214a174bb25e ; echo git reset --hard b33fe3ce7039944a5a18aefcc51c214a174bb25e ; -cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -echo cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell -echo cd /home/tong/src/openeuler/utshell; -echo 6 >> record.txt +cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 17 >> record.txt echo echo b33fe3ce7039944a5a18aefcc51c214a174bb25e to record.txt ; git add .; echo git add .; git commit -m " 优化指针传参问题" echo git commit -m 优化指针传参问题 ; -git push origin bv6 -echo git push origin bv6; -cd /home/tong/src/bash -echo cd /home/tong/src/bash; +git push origin bv17 +echo git push origin bv17; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; read -echo cd /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell; -echo git checkout -b bv7; -git checkout -b bv7; -cd /home/tong/src/bash; -echo cd /home/tong/src/bash; +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv18; +git checkout -b bv18; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; git reset --hard 7e248b9bceea2cb5a53fa8267db60951966f0d8d ; echo git reset --hard 7e248b9bceea2cb5a53fa8267db60951966f0d8d ; -cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -echo cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell -echo cd /home/tong/src/openeuler/utshell; -echo 7 >> record.txt +cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 18 >> record.txt echo echo 7e248b9bceea2cb5a53fa8267db60951966f0d8d to record.txt ; git add .; echo git add .; git commit -m " Merge "优化指针传参问题" into rustdev" echo git commit -m Merge "优化指针传参问题" into rustdev ; -git push origin bv7 -echo git push origin bv7; -cd /home/tong/src/bash -echo cd /home/tong/src/bash; +git push origin bv18 +echo git push origin bv18; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; read -echo cd /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell; -echo git checkout -b bv8; -git checkout -b bv8; -cd /home/tong/src/bash; -echo cd /home/tong/src/bash; +echo cd /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell; +echo git checkout -b bv19; +git checkout -b bv19; +cd /home/huan/gerrit/bash; +echo cd /home/huan/gerrit/bash; git reset --hard ec052778560599039fdbc50419d367acaa63b00a ; echo git reset --hard ec052778560599039fdbc50419d367acaa63b00a ; -cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -echo cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell -echo cd /home/tong/src/openeuler/utshell; -echo 8 >> record.txt +cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +echo cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; +cd /home/huan/gerrit/utshell +echo cd /home/huan/gerrit/utshell; +echo 19 >> record.txt echo echo ec052778560599039fdbc50419d367acaa63b00a to record.txt ; git add .; echo git add .; git commit -m " refactor: add r_execute_cmd function" echo git commit -m refactor: add r_execute_cmd function ; -git push origin bv8 -echo git push origin bv8; -cd /home/tong/src/bash -echo cd /home/tong/src/bash; -read -echo cd /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell; -echo git checkout -b bv9; -git checkout -b bv9; -cd /home/tong/src/bash; -echo cd /home/tong/src/bash; -git reset --hard 9b18ec1b6383bea95912c78856c0442e5185304c ; -echo git reset --hard 9b18ec1b6383bea95912c78856c0442e5185304c ; -cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -echo cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell -echo cd /home/tong/src/openeuler/utshell; -echo 9 >> record.txt -echo echo 9b18ec1b6383bea95912c78856c0442e5185304c to record.txt ; -git add .; -echo git add .; -git commit -m " refactor: modify execute_cmd function,part 1" -echo git commit -m refactor: modify execute_cmd function,part 1 ; -git push origin bv9 -echo git push origin bv9; -cd /home/tong/src/bash -echo cd /home/tong/src/bash; -read -echo cd /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell; -echo git checkout -b bv10; -git checkout -b bv10; -cd /home/tong/src/bash; -echo cd /home/tong/src/bash; -git reset --hard 1efade178d50e6e98946958ab076d1e1cc3d4676 ; -echo git reset --hard 1efade178d50e6e98946958ab076d1e1cc3d4676 ; -cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -echo cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell -echo cd /home/tong/src/openeuler/utshell; -echo 10 >> record.txt -echo echo 1efade178d50e6e98946958ab076d1e1cc3d4676 to record.txt ; -git add .; -echo git add .; -git commit -m " 添加fg_bg 命令 rust 代码" -echo git commit -m 添加fg_bg 命令 rust 代码 ; -git push origin bv10 -echo git push origin bv10; -cd /home/tong/src/bash -echo cd /home/tong/src/bash; -read -echo cd /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell; -echo git checkout -b bv11; -git checkout -b bv11; -cd /home/tong/src/bash; -echo cd /home/tong/src/bash; -git reset --hard 5a92722cbfd79d4f44b53d29c644de9449d9a9b5 ; -echo git reset --hard 5a92722cbfd79d4f44b53d29c644de9449d9a9b5 ; -cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -echo cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell -echo cd /home/tong/src/openeuler/utshell; -echo 11 >> record.txt -echo echo 5a92722cbfd79d4f44b53d29c644de9449d9a9b5 to record.txt ; -git add .; -echo git add .; -git commit -m " Merge "refactor: modify execute_cmd function,part 1" into rustdev" -echo git commit -m Merge "refactor: modify execute_cmd function,part 1" into rustdev ; -git push origin bv11 -echo git push origin bv11; -cd /home/tong/src/bash -echo cd /home/tong/src/bash; -read -echo cd /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell; -echo git checkout -b bv12; -git checkout -b bv12; -cd /home/tong/src/bash; -echo cd /home/tong/src/bash; -git reset --hard 31346f4ffaae817b3242928f473619b7d06d94bd ; -echo git reset --hard 31346f4ffaae817b3242928f473619b7d06d94bd ; -cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -echo cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell -echo cd /home/tong/src/openeuler/utshell; -echo 12 >> record.txt -echo echo 31346f4ffaae817b3242928f473619b7d06d94bd to record.txt ; -git add .; -echo git add .; -git commit -m " 添加cd rust 源码,并优化指针判空写法" -echo git commit -m 添加cd rust 源码,并优化指针判空写法 ; -git push origin bv12 -echo git push origin bv12; -cd /home/tong/src/bash -echo cd /home/tong/src/bash; -read -echo cd /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell; -echo git checkout -b bv13; -git checkout -b bv13; -cd /home/tong/src/bash; -echo cd /home/tong/src/bash; -git reset --hard 8370b614793b54261b1ef08bdeb0aa36eb8f01a2 ; -echo git reset --hard 8370b614793b54261b1ef08bdeb0aa36eb8f01a2 ; -cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -echo cp -r /home/tong/src/bash//* /home/tong/src/openeuler/utshell; -cd /home/tong/src/openeuler/utshell -echo cd /home/tong/src/openeuler/utshell; -echo 13 >> record.txt -echo echo 8370b614793b54261b1ef08bdeb0aa36eb8f01a2 to record.txt ; -git add .; -echo git add .; -git commit -m " 1 添加fc命令源码 2 优化代码规范,去掉多余的空格 3 添加注册函数" -echo git commit -m 1 添加fc命令源码 2 优化代码规范,去掉多余的空格 3 添加注册函数 ; -git push origin bv13 -echo git push origin bv13; -cd /home/tong/src/bash -echo cd /home/tong/src/bash; +git push origin bv19 +echo git push origin bv19; +cd /home/huan/gerrit/bash +echo cd /home/huan/gerrit/bash; read -- Gitee From 3d2318b2d9810c23120c30cb273f1ec467d358cb Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Wed, 14 Jun 2023 10:32:36 +0800 Subject: [PATCH 02/12] add README821d31e4f75848ca30bf5b5bede06256907b09f0 --- record.txt | 1 + x.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/record.txt b/record.txt index 397c583f..cb9cdd4e 100644 --- a/record.txt +++ b/record.txt @@ -12,3 +12,4 @@ 12 13 12 +12 diff --git a/x.sh b/x.sh index 28d90989..d79301be 100755 --- a/x.sh +++ b/x.sh @@ -4,6 +4,7 @@ echo git checkout -b bv12; git checkout -b bv12; cd /home/huan/gerrit/bash; echo cd /home/huan/gerrit/bash; +pwd git reset --hard 4e5ff3911664c3535659c83e05c05d6d809e57d5 ; echo git reset --hard 4e5ff3911664c3535659c83e05c05d6d809e57d5 ; cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; -- Gitee From 890567660dd7408996133e8c2bf3846895da35df Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Wed, 14 Jun 2023 10:34:23 +0800 Subject: [PATCH 03/12] add README821d31e4f75848ca30bf5b5bede06256907b09f0 --- record.txt | 1 + x.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/record.txt b/record.txt index cb9cdd4e..a459256f 100644 --- a/record.txt +++ b/record.txt @@ -13,3 +13,4 @@ 13 12 12 +12 diff --git a/x.sh b/x.sh index d79301be..6426ce3e 100755 --- a/x.sh +++ b/x.sh @@ -4,7 +4,7 @@ echo git checkout -b bv12; git checkout -b bv12; cd /home/huan/gerrit/bash; echo cd /home/huan/gerrit/bash; -pwd +echo '11111111111' git reset --hard 4e5ff3911664c3535659c83e05c05d6d809e57d5 ; echo git reset --hard 4e5ff3911664c3535659c83e05c05d6d809e57d5 ; cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; -- Gitee From eefaa89fcfe3c1cf9245893836ce0b6773582f5c Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Wed, 14 Jun 2023 10:57:59 +0800 Subject: [PATCH 04/12] add README821d31e4f75848ca30bf5b5bede06256907b09f0 --- record.txt | 1 + x.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/record.txt b/record.txt index a459256f..8c9cf32a 100644 --- a/record.txt +++ b/record.txt @@ -14,3 +14,4 @@ 12 12 12 +12 diff --git a/x.sh b/x.sh index 6426ce3e..da55268d 100755 --- a/x.sh +++ b/x.sh @@ -4,7 +4,6 @@ echo git checkout -b bv12; git checkout -b bv12; cd /home/huan/gerrit/bash; echo cd /home/huan/gerrit/bash; -echo '11111111111' git reset --hard 4e5ff3911664c3535659c83e05c05d6d809e57d5 ; echo git reset --hard 4e5ff3911664c3535659c83e05c05d6d809e57d5 ; cp -r /home/huan/gerrit/bash/* /home/huan/gerrit/utshell; @@ -21,6 +20,7 @@ git push origin bv12 echo git push origin bv12; cd /home/huan/gerrit/bash echo cd /home/huan/gerrit/bash; +echo '11111111111' read echo cd /home/huan/gerrit/utshell; cd /home/huan/gerrit/utshell; -- Gitee From 625962a4467a005a578fe5397d02955ed4714142 Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Wed, 14 Jun 2023 11:04:11 +0800 Subject: [PATCH 05/12] add README821d31e4f75848ca30bf5b5bede06256907b09f0 --- .x.sh.swp | Bin 0 -> 16384 bytes record.txt | 1 + x.sh | 9 --------- 3 files changed, 1 insertion(+), 9 deletions(-) create mode 100644 .x.sh.swp diff --git a/.x.sh.swp b/.x.sh.swp new file mode 100644 index 0000000000000000000000000000000000000000..004f10b3b34129de6eb6588d1bff6cff7a372c9a GIT binary patch literal 16384 zcmeI2ZEO@p9L9$?5fm`M7d6qb@&Sz3?%V9_QbIz24`6B#R1g!J-Pze*rPr%_cSwwZ zXiRvq!9;u^AqWv-G#WlAY79j2B^uH2#i$8Hh_S^qgcw0X{6c*8de=MK-F8bG#b!78 z-S%$gKR5gAJe~c|oU1&%s)bsOD#39JA@AP1(_2Wo$+lBdNVep3h98e~g!M9OmXB18 zYz-?mwaFl8FE*8mg{<~}s0 zCez?lfmDH1fmDH1fmDH1fmDH1fmDJ2mjcDE$z&V4Jh{^C*2;O(p!1Z<`v)p#IjFqy zHa(>Zqza@8qza@8qza@8qza@8qza@8qza@8qzYVz3OF7iVa|UgO!%??U(Nr2nnTDZ z;4s(?3Sb?W2Tsi<5sgA#Z|i@B~-`GGGq)<3>Wxg3rMrAiy1X&?)-NHdwN z6L@Vn${)qO)~ZsTXue=Kcnwiz3^q{CuPmn5@chy^SfW^{cB? z$WodQ+S}SY!#=ZS5_WgU$F&HN&*e}flcV(fhsSz%9eh0R7HCi^;QI5PgpTDFYSkJd z>oxSZNW*V)JdZZ^hgJS8--z;yr|Vo*G=rO(p?I#!m?l)!P*vS`EnPJo#kDzCd`gRX z3=@$LyvE{|;=tWh8C|-xuAu*GhgWvE(n@?6%>*&xHr+!bN(Sz%7(R69&>M&>>k;Zz z?*>YfD-?<{*7)(Y2!`9hRSj|viiW!n|D8pQXp0ziS5mV`Abm#^^TA@8%Wsy{Ewy(P z+dB)b`JgQvu+{fbu1Of0)JV4Ud_{QDVxH8b%b2Be#Z)C{t|olT(gb`Z8H+WNG0}~b zT%l+qjV^wCjf6oNXCxF|pGMN7jilFINtBVoDWW{x_<@s?Pv(P7)XxV4R%#sHOCv=m zwUcML%$J7bCf8j>R}?NZLsz-RbnXhvaJk0?OcrY=eWKebxkAx)8eRPO+6hB5&Q2)0 zKJBDM+exdtlA4`D8?0TqY(>jTOH(~vm4?rmWmv+|71w7jbEPL0Q)8yBa96=obohik zi+&Qe zRpk3;!E4|Va3?s2T>mq00PF-SfDIOcKIHr18o+K4fc3xx^T40T^-qH@z*}G^SOunn zlgRaVfgD&34DcKB{2uTf*bf|VA7}#eL8#|N@GJNkoB^jndZY^cO9}+i@hBPkTK)eN zk$Vp;-o%vE{uK>g_pqbqRJ#^YTjxMpUd{E&51FlUixj1zY!x|=`lU`$Y|nQ_O`=KS zlFphElcUDD#Y~0SwxZj<=L)76s_p3}cZB1ZcwAMS*vC?PqR*Pi6^foUM;Biml|z?x z1_otZQMghwXiWseF>cmG(U@n=YG-3?QvQaRvRc0eTgZyGkX4JQvrvl++9Yl0Ili~I z`<3(E+xuSJ(R2J@?+efNy?UhY^}P+Wy)#_q!(yW+H%EDCR1G9G6_=V}xwb2$bTr{I zhv~j!X(snvQ?Z$9o2IXLmKSR(YoePfxkAyV8eM#KoW?mP(g^*2i!c=iXq>4~6xr54 zmt>Pwi80Q#nTki7iq~C9E!T^4QL#^{tLwhhh2)reY{PJvqgsyig2rzNxQN@`ZA suE)2AQ_SM>##H%9v#X;NZjeQ+fD9jz)HcbtDPwG7PITKOS17d2-^*b-^8f$< literal 0 HcmV?d00001 diff --git a/record.txt b/record.txt index 8c9cf32a..ed290947 100644 --- a/record.txt +++ b/record.txt @@ -15,3 +15,4 @@ 12 12 12 +12 diff --git a/x.sh b/x.sh index da55268d..e4d14db8 100755 --- a/x.sh +++ b/x.sh @@ -20,8 +20,6 @@ git push origin bv12 echo git push origin bv12; cd /home/huan/gerrit/bash echo cd /home/huan/gerrit/bash; -echo '11111111111' -read echo cd /home/huan/gerrit/utshell; cd /home/huan/gerrit/utshell; echo git checkout -b bv13; @@ -44,7 +42,6 @@ git push origin bv13 echo git push origin bv13; cd /home/huan/gerrit/bash echo cd /home/huan/gerrit/bash; -read echo cd /home/huan/gerrit/utshell; cd /home/huan/gerrit/utshell; echo git checkout -b bv14; @@ -67,7 +64,6 @@ git push origin bv14 echo git push origin bv14; cd /home/huan/gerrit/bash echo cd /home/huan/gerrit/bash; -read echo cd /home/huan/gerrit/utshell; cd /home/huan/gerrit/utshell; echo git checkout -b bv15; @@ -90,7 +86,6 @@ git push origin bv15 echo git push origin bv15; cd /home/huan/gerrit/bash echo cd /home/huan/gerrit/bash; -read echo cd /home/huan/gerrit/utshell; cd /home/huan/gerrit/utshell; echo git checkout -b bv16; @@ -113,7 +108,6 @@ git push origin bv16 echo git push origin bv16; cd /home/huan/gerrit/bash echo cd /home/huan/gerrit/bash; -read echo cd /home/huan/gerrit/utshell; cd /home/huan/gerrit/utshell; echo git checkout -b bv17; @@ -136,7 +130,6 @@ git push origin bv17 echo git push origin bv17; cd /home/huan/gerrit/bash echo cd /home/huan/gerrit/bash; -read echo cd /home/huan/gerrit/utshell; cd /home/huan/gerrit/utshell; echo git checkout -b bv18; @@ -159,7 +152,6 @@ git push origin bv18 echo git push origin bv18; cd /home/huan/gerrit/bash echo cd /home/huan/gerrit/bash; -read echo cd /home/huan/gerrit/utshell; cd /home/huan/gerrit/utshell; echo git checkout -b bv19; @@ -182,4 +174,3 @@ git push origin bv19 echo git push origin bv19; cd /home/huan/gerrit/bash echo cd /home/huan/gerrit/bash; -read -- Gitee From b3058a9ab0f84aa58508f7d17a86d8564948f9d0 Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Wed, 14 Jun 2023 11:04:28 +0800 Subject: [PATCH 06/12] refactor: add rust framework for builtins. --- .x.sh.swp | Bin 16384 -> 16384 bytes bash-5.1/.gitignore | 1 - bash-5.1/Cargo.toml | 8 +------- bash-5.1/configure | 3 +-- bash-5.1/execute_cmd.c | 5 +---- record.txt | 1 + 6 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.x.sh.swp b/.x.sh.swp index 004f10b3b34129de6eb6588d1bff6cff7a372c9a..245e34dd0607ff225ce95ecbb61ff9710559bff7 100644 GIT binary patch delta 46 zcmZo@U~Fh$R7f%i^Ym4)&@*HJ0s#gFb-m6M3x*zs`g6<-8KsGN6DO){blGDM00pfK Apa1{> delta 46 zcmZo@U~Fh$R7f%i^Ym4)&@*HJ0s#hwO*)+^8Vo%Q_2-xwGD;KkCQek@=(5Ki01(a% A82|tP diff --git a/bash-5.1/.gitignore b/bash-5.1/.gitignore index 4c50e886..6c7dbc5f 100644 --- a/bash-5.1/.gitignore +++ b/bash-5.1/.gitignore @@ -1,5 +1,4 @@ *.swp tags -Cargo.lock target/ .vscode diff --git a/bash-5.1/Cargo.toml b/bash-5.1/Cargo.toml index 6e02f0ac..ec2f4f94 100644 --- a/bash-5.1/Cargo.toml +++ b/bash-5.1/Cargo.toml @@ -2,17 +2,11 @@ name = "rsbash" version = "0.1.0" edition = "2021" -[lib] -name = "rsbash" -crate-type = ["cdylib"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [workspace] -members = ["builtins_rust/read", "builtins/command1", "builtins/command2", "builtins_rust/common"] +members = ["builtins/command1", "builtins/command2"] [dependencies] -libc = "0.2" command1 = {path = "./builtins/command1"} command2 = {path = "./builtins/command2"} -read = {path = "./builtins_rust/read"} -common = {path = "./builtins_rust/common"} diff --git a/bash-5.1/configure b/bash-5.1/configure index 0d917697..0f1d3ed1 100755 --- a/bash-5.1/configure +++ b/bash-5.1/configure @@ -4231,7 +4231,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$want_auto_cflags"; then AUTO_CFLAGS="-g ${GCC+-O2}" AUTO_LDFLAGS="-g ${GCC+-O2}" - STYLE_CFLAGS="${GCC+-Wno-parentheses} ${GCC+-Wno-format-security} ${GCC+-fPIC}" + STYLE_CFLAGS="${GCC+-Wno-parentheses} ${GCC+-Wno-format-security}" else AUTO_CFLAGS= AUTO_LDFLAGS= STYLE_CFLAGS= fi @@ -20255,7 +20255,6 @@ fi $as_echo "using $bash_cv_termcap_lib" >&6; } if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then LDFLAGS="$LDFLAGS -L./lib/termcap" - TERMCAP_LIB="./lib/termcap/libtermcap.a" TERMCAP_DEP="./lib/termcap/libtermcap.a" elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then diff --git a/bash-5.1/execute_cmd.c b/bash-5.1/execute_cmd.c index 9d66af0b..c86c1a07 100644 --- a/bash-5.1/execute_cmd.c +++ b/bash-5.1/execute_cmd.c @@ -110,8 +110,6 @@ extern int errno; # include /* mbschr */ #endif -# include "./rsbuiltins.h" - extern int command_string_index; extern char *the_printed_command; extern time_t shell_start_time; @@ -4737,7 +4735,6 @@ execute_builtin (builtin, words, flags, subshell) error_trap = 0; should_keep = 0; - //r_execute_cmd(); /* The eval builtin calls parse_and_execute, which does not know about the setting of flags, and always calls the execution functions with flags that will exit the shell on an error if -e is set. If the @@ -4841,7 +4838,6 @@ execute_builtin (builtin, words, flags, subshell) executing_builtin++; executing_command_builtin |= builtin == command_builtin; result = ((*builtin) (words->next)); - // r_execute_cmd2(words->next); /* This shouldn't happen, but in case `return' comes back instead of longjmp'ing, we need to unwind. */ @@ -5312,6 +5308,7 @@ execute_builtin_or_function (words, builtin, var, redirects, int ofifo, nfifo, osize; void *ofifo_list; #endif + #if defined (PROCESS_SUBSTITUTION) begin_unwind_frame ("saved_fifos"); /* If we return, we longjmp and don't get a chance to restore the old diff --git a/record.txt b/record.txt index ed290947..ef1b6000 100644 --- a/record.txt +++ b/record.txt @@ -16,3 +16,4 @@ 12 12 12 +13 -- Gitee From e9476fe872b3cfc632e0f217d83167bb18d87aa2 Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Wed, 14 Jun 2023 11:04:42 +0800 Subject: [PATCH 07/12] refactor: move builtins_org to builtins --- bash-5.1/builtins/read.def | 1074 +++++++++++++++++++++++++++++++++++- record.txt | 1 + 2 files changed, 1071 insertions(+), 4 deletions(-) diff --git a/bash-5.1/builtins/read.def b/bash-5.1/builtins/read.def index 6e1f5375..39e16e84 100644 --- a/bash-5.1/builtins/read.def +++ b/bash-5.1/builtins/read.def @@ -1,3 +1,23 @@ +This file is read.def, from which is created read.c. +It implements the builtin "read" in Bash. + +Copyright (C) 1987-2020 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + $PRODUCES read.c $BUILTIN read @@ -92,11 +112,59 @@ $END extern int errno; #endif -extern int r_read_builtin (WORD_LIST *); +struct ttsave +{ + int fd; + TTYSTRUCT attrs; +}; + +#if defined (READLINE) +static void reset_attempted_completion_function PARAMS((char *)); +static int set_itext PARAMS((void)); +static char *edit_line PARAMS((char *, char *)); +static void set_eol_delim PARAMS((int)); +static void reset_eol_delim PARAMS((char *)); +#endif +static SHELL_VAR *bind_read_variable PARAMS((char *, char *)); +#if defined (HANDLE_MULTIBYTE) +static int read_mbchar PARAMS((int, char *, int, int, int)); +#endif +static void ttyrestore PARAMS((struct ttsave *)); + +static sighandler sigalrm PARAMS((int)); +static void reset_alarm PARAMS((void)); +/* Try this to see what the rest of the shell can do with the information. */ procenv_t alrmbuf; int sigalrm_seen; +static int reading, tty_modified; +static SigHandler *old_alrm; +static unsigned char delim; + +static struct ttsave termsave; + +/* In all cases, SIGALRM just sets a flag that we check periodically. This + avoids problems with the semi-tricky stuff we do with the xfree of + input_string at the top of the unwind-protect list (see below). */ + +/* Set a flag that CHECK_ALRM can check. This relies on zread or read_builtin + calling trap.c:check_signals(), which knows about sigalrm_seen and alrmbuf. */ +static sighandler +sigalrm (s) + int s; +{ + sigalrm_seen = 1; +} + +static void +reset_alarm () +{ + /* Cancel alarm before restoring signal handler. */ + falarm (0, 0); + set_signal_handler (SIGALRM, old_alrm); +} + /* Read the value of the shell variables whose names follow. The reading is done from the current input stream, whatever that may be. Successive words of the input line are assigned @@ -107,18 +175,1016 @@ int read_builtin (list) WORD_LIST *list; { - r_read_builtin(list); + register char *varname; + int size, nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2, nflag; + volatile int i; + int input_is_tty, input_is_pipe, unbuffered_read, skip_ctlesc, skip_ctlnul; + int raw, edit, nchars, silent, have_timeout, ignore_delim, fd; + int lastsig, t_errno; + int mb_cur_max; + unsigned int tmsec, tmusec; + long ival, uval; + intmax_t intval; + char c; + char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname; + char *e, *t, *t1, *ps2, *tofree; + struct stat tsb; + SHELL_VAR *var; + TTYSTRUCT ttattrs, ttset; +#if defined (ARRAY_VARS) + WORD_LIST *alist; + int vflags; +#endif +#if defined (READLINE) + char *rlbuf, *itext; + int rlind; + FILE *save_instream; +#endif + + USE_VAR(size); + USE_VAR(i); + USE_VAR(pass_next); + USE_VAR(print_ps2); + USE_VAR(saw_escape); + USE_VAR(input_is_pipe); +/* USE_VAR(raw); */ + USE_VAR(edit); + USE_VAR(tmsec); + USE_VAR(tmusec); + USE_VAR(nchars); + USE_VAR(silent); + USE_VAR(ifs_chars); + USE_VAR(prompt); + USE_VAR(arrayname); +#if defined (READLINE) + USE_VAR(rlbuf); + USE_VAR(rlind); + USE_VAR(itext); +#endif + USE_VAR(list); + USE_VAR(ps2); + USE_VAR(lastsig); + + sigalrm_seen = reading = tty_modified = 0; + + i = 0; /* Index into the string that we are reading. */ + raw = edit = 0; /* Not reading raw input by default. */ + silent = 0; + arrayname = prompt = (char *)NULL; + fd = 0; /* file descriptor to read from */ + +#if defined (READLINE) + rlbuf = itext = (char *)0; + rlind = 0; +#endif + + mb_cur_max = MB_CUR_MAX; + tmsec = tmusec = 0; /* no timeout */ + nr = nchars = input_is_tty = input_is_pipe = unbuffered_read = have_timeout = 0; + delim = '\n'; /* read until newline */ + ignore_delim = nflag = 0; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "ersa:d:i:n:p:t:u:N:")) != -1) + { + switch (opt) + { + case 'r': + raw = 1; + break; + case 'p': + prompt = list_optarg; + break; + case 's': + silent = 1; + break; + case 'e': +#if defined (READLINE) + edit = 1; +#endif + break; + case 'i': +#if defined (READLINE) + itext = list_optarg; +#endif + break; +#if defined (ARRAY_VARS) + case 'a': + arrayname = list_optarg; + break; +#endif + case 't': + code = uconvert (list_optarg, &ival, &uval, (char **)NULL); + if (code == 0 || ival < 0 || uval < 0) + { + builtin_error (_("%s: invalid timeout specification"), list_optarg); + return (EXECUTION_FAILURE); + } + else + { + have_timeout = 1; + tmsec = ival; + tmusec = uval; + } + break; + case 'N': + ignore_delim = 1; + delim = -1; + case 'n': + nflag = 1; + code = legal_number (list_optarg, &intval); + if (code == 0 || intval < 0 || intval != (int)intval) + { + sh_invalidnum (list_optarg); + return (EXECUTION_FAILURE); + } + else + nchars = intval; + break; + case 'u': + code = legal_number (list_optarg, &intval); + if (code == 0 || intval < 0 || intval != (int)intval) + { + builtin_error (_("%s: invalid file descriptor specification"), list_optarg); + return (EXECUTION_FAILURE); + } + else + fd = intval; + if (sh_validfd (fd) == 0) + { + builtin_error (_("%d: invalid file descriptor: %s"), fd, strerror (errno)); + return (EXECUTION_FAILURE); + } + break; + case 'd': + delim = *list_optarg; + break; + CASE_HELPOPT; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + /* `read -t 0 var' tests whether input is available with select/FIONREAD, + and fails if those are unavailable */ + if (have_timeout && tmsec == 0 && tmusec == 0) +#if 0 + return (EXECUTION_FAILURE); +#else + return (input_avail (fd) ? EXECUTION_SUCCESS : EXECUTION_FAILURE); +#endif + + /* Convenience: check early whether or not the first of possibly several + variable names is a valid identifier, and bail early if so. */ +#if defined (ARRAY_VARS) + vflags = assoc_expand_once ? (VA_NOEXPAND|VA_ONEWORD) : 0; + if (list && legal_identifier (list->word->word) == 0 && valid_array_reference (list->word->word, vflags) == 0) +#else + if (list && legal_identifier (list->word->word) == 0) +#endif + { + sh_invalidid (list->word->word); + return (EXECUTION_FAILURE); + } + + /* If we're asked to ignore the delimiter, make sure we do. */ + if (ignore_delim) + delim = -1; + + /* IF IFS is unset, we use the default of " \t\n". */ + ifs_chars = getifs (); + if (ifs_chars == 0) /* XXX - shouldn't happen */ + ifs_chars = ""; + /* If we want to read exactly NCHARS chars, don't split on IFS */ + if (ignore_delim) + ifs_chars = ""; + for (skip_ctlesc = skip_ctlnul = 0, e = ifs_chars; *e; e++) + skip_ctlesc |= *e == CTLESC, skip_ctlnul |= *e == CTLNUL; + + input_string = (char *)xmalloc (size = 112); /* XXX was 128 */ + input_string[0] = '\0'; + + /* More input and options validation */ + if (nflag == 1 && nchars == 0) + { + retval = read (fd, &c, 0); + retval = (retval >= 0) ? EXECUTION_SUCCESS : EXECUTION_FAILURE; + goto assign_vars; /* bail early if asked to read 0 chars */ + } + + /* $TMOUT, if set, is the default timeout for read. */ + if (have_timeout == 0 && (e = get_string_value ("TMOUT"))) + { + code = uconvert (e, &ival, &uval, (char **)NULL); + if (code == 0 || ival < 0 || uval < 0) + tmsec = tmusec = 0; + else + { + tmsec = ival; + tmusec = uval; + } + } + + begin_unwind_frame ("read_builtin"); + +#if defined (BUFFERED_INPUT) + if (interactive == 0 && default_buffered_input >= 0 && fd_is_bash_input (fd)) + sync_buffered_stream (default_buffered_input); +#endif + +#if 1 + input_is_tty = isatty (fd); +#else + input_is_tty = 1; +#endif + if (input_is_tty == 0) +#ifndef __CYGWIN__ + input_is_pipe = (lseek (fd, 0L, SEEK_CUR) < 0) && (errno == ESPIPE); +#else + input_is_pipe = 1; +#endif + + /* If the -p, -e or -s flags were given, but input is not coming from the + terminal, turn them off. */ + if ((prompt || edit || silent) && input_is_tty == 0) + { + prompt = (char *)NULL; +#if defined (READLINE) + itext = (char *)NULL; +#endif + edit = silent = 0; + } + +#if defined (READLINE) + if (edit) + add_unwind_protect (xfree, rlbuf); +#endif + + pass_next = 0; /* Non-zero signifies last char was backslash. */ + saw_escape = 0; /* Non-zero signifies that we saw an escape char */ + + if (tmsec > 0 || tmusec > 0) + { + /* Turn off the timeout if stdin is a regular file (e.g. from + input redirection). */ + if ((fstat (fd, &tsb) < 0) || S_ISREG (tsb.st_mode)) + tmsec = tmusec = 0; + } + + if (tmsec > 0 || tmusec > 0) + { + code = setjmp_nosigs (alrmbuf); + if (code) + { + sigalrm_seen = 0; + /* Tricky. The top of the unwind-protect stack is the free of + input_string. We want to run all the rest and use input_string, + so we have to save input_string temporarily, run the unwind- + protects, then restore input_string so we can use it later */ + orig_input_string = 0; + input_string[i] = '\0'; /* make sure it's terminated */ + if (i == 0) + { + t = (char *)xmalloc (1); + t[0] = 0; + } + else + t = savestring (input_string); + + run_unwind_frame ("read_builtin"); + input_string = t; + retval = 128+SIGALRM; + goto assign_vars; + } + if (interactive_shell == 0) + initialize_terminating_signals (); + old_alrm = set_signal_handler (SIGALRM, sigalrm); + add_unwind_protect (reset_alarm, (char *)NULL); +#if defined (READLINE) + if (edit) + { + add_unwind_protect (reset_attempted_completion_function, (char *)NULL); + add_unwind_protect (bashline_reset_event_hook, (char *)NULL); + } +#endif + falarm (tmsec, tmusec); + } + + /* If we've been asked to read only NCHARS chars, or we're using some + character other than newline to terminate the line, do the right + thing to readline or the tty. */ + if (nchars > 0 || delim != '\n') + { +#if defined (READLINE) + if (edit) + { + if (nchars > 0) + { + unwind_protect_int (rl_num_chars_to_read); + rl_num_chars_to_read = nchars; + } + if (delim != '\n') + { + set_eol_delim (delim); + add_unwind_protect (reset_eol_delim, (char *)NULL); + } + } + else +#endif + if (input_is_tty) + { + /* ttsave() */ + termsave.fd = fd; + ttgetattr (fd, &ttattrs); + termsave.attrs = ttattrs; + + ttset = ttattrs; + i = silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset); + if (i < 0) + sh_ttyerror (1); + tty_modified = 1; + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); + if (interactive_shell == 0) + initialize_terminating_signals (); + } + } + else if (silent) /* turn off echo but leave term in canonical mode */ + { + /* ttsave (); */ + termsave.fd = fd; + ttgetattr (fd, &ttattrs); + termsave.attrs = ttattrs; + + ttset = ttattrs; + i = ttfd_noecho (fd, &ttset); /* ttnoecho (); */ + if (i < 0) + sh_ttyerror (1); + + tty_modified = 1; + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); + if (interactive_shell == 0) + initialize_terminating_signals (); + } + +#if defined (READLINE) + save_instream = 0; + if (edit && fd != 0) + { + if (bash_readline_initialized == 0) + initialize_readline (); + + unwind_protect_var (rl_instream); + save_instream = rl_instream; + rl_instream = fdopen (fd, "r"); + } +#endif + + /* This *must* be the top unwind-protect on the stack, so the manipulation + of the unwind-protect stack after the realloc() works right. */ + add_unwind_protect (xfree, input_string); + + CHECK_ALRM; + if ((nchars > 0) && (input_is_tty == 0) && ignore_delim) /* read -N */ + unbuffered_read = 2; + else if ((nchars > 0) || (delim != '\n') || input_is_pipe) + unbuffered_read = 1; + + if (prompt && edit == 0) + { + fprintf (stderr, "%s", prompt); + fflush (stderr); + } + +#if defined (__CYGWIN__) && defined (O_TEXT) + setmode (0, O_TEXT); +#endif + + ps2 = 0; + for (print_ps2 = eof = retval = 0;;) + { + CHECK_ALRM; + +#if defined (READLINE) + if (edit) + { + /* If we have a null delimiter, don't treat NULL as ending the line */ + if (rlbuf && rlbuf[rlind] == '\0' && delim != '\0') + { + free (rlbuf); + rlbuf = (char *)0; + } + if (rlbuf == 0) + { + reading = 1; + rlbuf = edit_line (prompt ? prompt : "", itext); + reading = 0; + rlind = 0; + } + if (rlbuf == 0) + { + eof = 1; + break; + } + c = rlbuf[rlind++]; + } + else + { +#endif + + if (print_ps2) + { + if (ps2 == 0) + ps2 = get_string_value ("PS2"); + fprintf (stderr, "%s", ps2 ? ps2 : ""); + fflush (stderr); + print_ps2 = 0; + } + + reading = 1; + CHECK_ALRM; + errno = 0; + if (unbuffered_read == 2) + retval = posixly_correct ? zreadintr (fd, &c, 1) : zreadn (fd, &c, nchars - nr); + else if (unbuffered_read) + retval = posixly_correct ? zreadintr (fd, &c, 1) : zread (fd, &c, 1); + else + retval = posixly_correct ? zreadcintr (fd, &c) : zreadc (fd, &c); + reading = 0; + + if (retval <= 0) + { + int t; + + t = errno; + if (retval < 0 && errno == EINTR) + { + check_signals (); /* in case we didn't call zread via zreadc */ + lastsig = LASTSIG(); + if (lastsig == 0) + lastsig = trapped_signal_received; +#if 0 + run_pending_traps (); /* because interrupt_immediately is not set */ +#endif + } + else + lastsig = 0; + if (terminating_signal && tty_modified) + ttyrestore (&termsave); /* fix terminal before exiting */ + CHECK_TERMSIG; + eof = 1; + errno = t; /* preserve it for the error message below */ + break; + } + + QUIT; /* in case we didn't call check_signals() */ +#if defined (READLINE) + } +#endif + + if (retval <= 0) /* XXX shouldn't happen */ + CHECK_ALRM; + + /* XXX -- use i + mb_cur_max (at least 4) for multibyte/read_mbchar */ + if (i + (mb_cur_max > 4 ? mb_cur_max : 4) >= size) + { + char *t; + t = (char *)xrealloc (input_string, size += 128); + + /* Only need to change unwind-protect if input_string changes */ + if (t != input_string) + { + input_string = t; + remove_unwind_protect (); + add_unwind_protect (xfree, input_string); + } + } + + /* If the next character is to be accepted verbatim, a backslash + newline pair still disappears from the input. */ + if (pass_next) + { + pass_next = 0; + if (c == '\n') + { + if (skip_ctlesc == 0 && i > 0) + i--; /* back up over the CTLESC */ + if (interactive && input_is_tty && raw == 0) + print_ps2 = 1; + } + else + goto add_char; + continue; + } + + /* This may cause problems if IFS contains CTLESC */ + if (c == '\\' && raw == 0) + { + pass_next++; + if (skip_ctlesc == 0) + { + saw_escape++; + input_string[i++] = CTLESC; + } + continue; + } + + if (ignore_delim == 0 && (unsigned char)c == delim) + break; + + if (c == '\0' && delim != '\0') + continue; /* skip NUL bytes in input */ + + if ((skip_ctlesc == 0 && c == CTLESC) || (skip_ctlnul == 0 && c == CTLNUL)) + { + saw_escape++; + input_string[i++] = CTLESC; + } + +add_char: + input_string[i++] = c; + CHECK_ALRM; + +#if defined (HANDLE_MULTIBYTE) + /* XXX - what if C == 127? Can DEL introduce a multibyte sequence? */ + if (mb_cur_max > 1 && is_basic (c) == 0) + { + input_string[i] = '\0'; /* for simplicity and debugging */ + /* If we got input from readline, grab the next multibyte char from + rlbuf. */ +# if defined (READLINE) + if (edit) + { + size_t clen; + clen = mbrlen (rlbuf + rlind - 1, mb_cur_max, (mbstate_t *)NULL); + /* We only deal with valid multibyte sequences longer than one + byte. If we get anything else, we leave the one character + copied and move on to the next. */ + if ((int)clen > 1) + { + memcpy (input_string+i, rlbuf+rlind, clen-1); + i += clen - 1; + rlind += clen - 1; + } + } + else +# endif + if (locale_utf8locale == 0 || ((c & 0x80) != 0)) + i += read_mbchar (fd, input_string, i, c, unbuffered_read); + } +#endif + + nr++; + + if (nchars > 0 && nr >= nchars) + break; + } + input_string[i] = '\0'; + CHECK_ALRM; + +#if defined (READLINE) + if (edit) + free (rlbuf); +#endif + + if (retval < 0) + { + t_errno = errno; + if (errno != EINTR) + builtin_error (_("read error: %d: %s"), fd, strerror (errno)); + run_unwind_frame ("read_builtin"); + return ((t_errno != EINTR) ? EXECUTION_FAILURE : 128+lastsig); + } + + if (tmsec > 0 || tmusec > 0) + reset_alarm (); + + if (nchars > 0 || delim != '\n') + { +#if defined (READLINE) + if (edit) + { + if (nchars > 0) + rl_num_chars_to_read = 0; + if (delim != '\n') + reset_eol_delim ((char *)NULL); + } + else +#endif + if (input_is_tty) + ttyrestore (&termsave); + } + else if (silent) + ttyrestore (&termsave); + + if (unbuffered_read == 0) + zsyncfd (fd); + +#if defined (READLINE) + if (save_instream) + rl_instream = save_instream; /* can't portably free it */ +#endif + + discard_unwind_frame ("read_builtin"); + + retval = eof ? EXECUTION_FAILURE : EXECUTION_SUCCESS; + +assign_vars: + +#if defined (ARRAY_VARS) + /* If -a was given, take the string read, break it into a list of words, + an assign them to `arrayname' in turn. */ + if (arrayname) + { + if (legal_identifier (arrayname) == 0) + { + sh_invalidid (arrayname); + free (input_string); + return (EXECUTION_FAILURE); + } + + var = find_or_make_array_variable (arrayname, 1); + if (var == 0) + { + free (input_string); + return EXECUTION_FAILURE; /* readonly or noassign */ + } + if (assoc_p (var)) + { + builtin_error (_("%s: cannot convert associative to indexed array"), arrayname); + free (input_string); + return EXECUTION_FAILURE; /* existing associative array */ + } + else if (invisible_p (var)) + VUNSETATTR (var, att_invisible); + array_flush (array_cell (var)); + + alist = list_string (input_string, ifs_chars, 0); + if (alist) + { + if (saw_escape) + dequote_list (alist); + else + word_list_remove_quoted_nulls (alist); + assign_array_var_from_word_list (var, alist, 0); + dispose_words (alist); + } + free (input_string); + return (retval); + } +#endif /* ARRAY_VARS */ + + /* If there are no variables, save the text of the line read to the + variable $REPLY. ksh93 strips leading and trailing IFS whitespace, + so that `read x ; echo "$x"' and `read ; echo "$REPLY"' behave the + same way, but I believe that the difference in behaviors is useful + enough to not do it. Without the bash behavior, there is no way + to read a line completely without interpretation or modification + unless you mess with $IFS (e.g., setting it to the empty string). + If you disagree, change the occurrences of `#if 0' to `#if 1' below. */ + if (list == 0) + { +#if 0 + orig_input_string = input_string; + for (t = input_string; ifs_chars && *ifs_chars && spctabnl(*t) && isifs(*t); t++) + ; + input_string = t; + input_string = strip_trailing_ifs_whitespace (input_string, ifs_chars, saw_escape); +#endif + + if (saw_escape) + { + t = dequote_string (input_string); + var = bind_variable ("REPLY", t, 0); + free (t); + } + else + var = bind_variable ("REPLY", input_string, 0); + if (var == 0 || readonly_p (var) || noassign_p (var)) + retval = EXECUTION_FAILURE; + else + VUNSETATTR (var, att_invisible); + + free (input_string); + return (retval); + } + + /* This code implements the Posix.2 spec for splitting the words + read and assigning them to variables. */ + orig_input_string = input_string; + + /* Remove IFS white space at the beginning of the input string. If + $IFS is null, no field splitting is performed. */ + for (t = input_string; ifs_chars && *ifs_chars && spctabnl(*t) && isifs(*t); t++) + ; + input_string = t; + for (; list->next; list = list->next) + { + varname = list->word->word; +#if defined (ARRAY_VARS) + if (legal_identifier (varname) == 0 && valid_array_reference (varname, vflags) == 0) +#else + if (legal_identifier (varname) == 0) +#endif + { + sh_invalidid (varname); + free (orig_input_string); + return (EXECUTION_FAILURE); + } + + /* If there are more variables than words read from the input, + the remaining variables are set to the empty string. */ + if (*input_string) + { + /* This call updates INPUT_STRING. */ + t = get_word_from_string (&input_string, ifs_chars, &e); + if (t) + *e = '\0'; + /* Don't bother to remove the CTLESC unless we added one + somewhere while reading the string. */ + if (t && saw_escape) + { + t1 = dequote_string (t); + var = bind_read_variable (varname, t1); + free (t1); + } + else + var = bind_read_variable (varname, t ? t : ""); + } + else + { + t = (char *)0; + var = bind_read_variable (varname, ""); + } + + FREE (t); + if (var == 0) + { + free (orig_input_string); + return (EXECUTION_FAILURE); + } + + stupidly_hack_special_variables (varname); + VUNSETATTR (var, att_invisible); + } + + /* Now assign the rest of the line to the last variable argument. */ +#if defined (ARRAY_VARS) + if (legal_identifier (list->word->word) == 0 && valid_array_reference (list->word->word, vflags) == 0) +#else + if (legal_identifier (list->word->word) == 0) +#endif + { + sh_invalidid (list->word->word); + free (orig_input_string); + return (EXECUTION_FAILURE); + } + +#if 0 + /* This has to be done this way rather than using string_list + and list_string because Posix.2 says that the last variable gets the + remaining words and their intervening separators. */ + input_string = strip_trailing_ifs_whitespace (input_string, ifs_chars, saw_escape); +#else + /* Check whether or not the number of fields is exactly the same as the + number of variables. */ + tofree = NULL; + if (*input_string) + { + t1 = input_string; + t = get_word_from_string (&input_string, ifs_chars, &e); + if (*input_string == 0) + tofree = input_string = t; + else + { + input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape); + tofree = t; + } + } +#endif + + if (saw_escape && input_string && *input_string) + { + t = dequote_string (input_string); + var = bind_read_variable (list->word->word, t); + free (t); + } + else + var = bind_read_variable (list->word->word, input_string ? input_string : ""); + + if (var) + { + stupidly_hack_special_variables (list->word->word); + VUNSETATTR (var, att_invisible); + } + else + retval = EXECUTION_FAILURE; + + FREE (tofree); + free (orig_input_string); + + return (retval); +} + +static SHELL_VAR * +bind_read_variable (name, value) + char *name, *value; +{ + SHELL_VAR *v; + + v = builtin_bind_variable (name, value, 0); + return (v == 0 ? v + : ((readonly_p (v) || noassign_p (v)) ? (SHELL_VAR *)NULL : v)); +} + +#if defined (HANDLE_MULTIBYTE) +static int +read_mbchar (fd, string, ind, ch, unbuffered) + int fd; + char *string; + int ind, ch, unbuffered; +{ + char mbchar[MB_LEN_MAX + 1]; + int i, n, r; + char c; + size_t ret; + mbstate_t ps, ps_back; + wchar_t wc; + + memset (&ps, '\0', sizeof (mbstate_t)); + memset (&ps_back, '\0', sizeof (mbstate_t)); + + mbchar[0] = ch; + i = 1; + for (n = 0; n <= MB_LEN_MAX; n++) + { + ps_back = ps; + ret = mbrtowc (&wc, mbchar, i, &ps); + if (ret == (size_t)-2) + { + ps = ps_back; + + /* We don't want to be interrupted during a multibyte char read */ + if (unbuffered == 2) + r = zreadn (fd, &c, 1); + else if (unbuffered) + r = zread (fd, &c, 1); + else + r = zreadc (fd, &c); + if (r <= 0) + goto mbchar_return; + mbchar[i++] = c; + continue; + } + else if (ret == (size_t)-1 || ret == (size_t)0 || ret > (size_t)0) + break; + } + +mbchar_return: + if (i > 1) /* read a multibyte char */ + /* mbchar[0] is already string[ind-1] */ + for (r = 1; r < i; r++) + string[ind+r-1] = mbchar[r]; + return i - 1; +} +#endif + + +static void +ttyrestore (ttp) + struct ttsave *ttp; +{ + ttsetattr (ttp->fd, &(ttp->attrs)); + tty_modified = 0; } void read_tty_cleanup () { - ; + if (tty_modified) + ttyrestore (&termsave); } int read_tty_modified () { - return 0; + return (tty_modified); +} + +#if defined (READLINE) +static rl_completion_func_t *old_attempted_completion_function = 0; +static rl_hook_func_t *old_startup_hook; +static char *deftext; + +static void +reset_attempted_completion_function (cp) + char *cp; +{ + if (rl_attempted_completion_function == 0 && old_attempted_completion_function) + rl_attempted_completion_function = old_attempted_completion_function; +} + +static int +set_itext () +{ + int r1, r2; + + r1 = r2 = 0; + if (old_startup_hook) + r1 = (*old_startup_hook) (); + if (deftext) + { + r2 = rl_insert_text (deftext); + deftext = (char *)NULL; + rl_startup_hook = old_startup_hook; + old_startup_hook = (rl_hook_func_t *)NULL; + } + return (r1 || r2); } +static char * +edit_line (p, itext) + char *p; + char *itext; +{ + char *ret; + int len; + + if (bash_readline_initialized == 0) + initialize_readline (); + + old_attempted_completion_function = rl_attempted_completion_function; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + bashline_set_event_hook (); + if (itext) + { + old_startup_hook = rl_startup_hook; + rl_startup_hook = set_itext; + deftext = itext; + } + + ret = readline (p); + + rl_attempted_completion_function = old_attempted_completion_function; + old_attempted_completion_function = (rl_completion_func_t *)NULL; + bashline_reset_event_hook (); + + if (ret == 0) + return ret; + len = strlen (ret); + ret = (char *)xrealloc (ret, len + 2); + ret[len++] = delim; + ret[len] = '\0'; + return ret; +} + +static int old_delim_ctype; +static rl_command_func_t *old_delim_func; +static int old_newline_ctype; +static rl_command_func_t *old_newline_func; + +static unsigned char delim_char; + +static void +set_eol_delim (c) + int c; +{ + Keymap cmap; + + if (bash_readline_initialized == 0) + initialize_readline (); + cmap = rl_get_keymap (); + + /* Save the old delimiter char binding */ + old_newline_ctype = cmap[RETURN].type; + old_newline_func = cmap[RETURN].function; + old_delim_ctype = cmap[c].type; + old_delim_func = cmap[c].function; + + /* Change newline to self-insert */ + cmap[RETURN].type = ISFUNC; + cmap[RETURN].function = rl_insert; + + /* Bind the delimiter character to accept-line. */ + cmap[c].type = ISFUNC; + cmap[c].function = rl_newline; + + delim_char = c; +} + +static void +reset_eol_delim (cp) + char *cp; +{ + Keymap cmap; + + cmap = rl_get_keymap (); + + cmap[RETURN].type = old_newline_ctype; + cmap[RETURN].function = old_newline_func; + + cmap[delim_char].type = old_delim_ctype; + cmap[delim_char].function = old_delim_func; +} +#endif diff --git a/record.txt b/record.txt index ef1b6000..b49e1f80 100644 --- a/record.txt +++ b/record.txt @@ -17,3 +17,4 @@ 12 12 13 +14 -- Gitee From 33da0e6e355844cf76f9b817af2d6b86eda1ea19 Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Wed, 14 Jun 2023 11:04:52 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0jobs=20rust=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash-5.1/builtins_rust/jobs/Cargo.toml | 2 +- bash-5.1/builtins_rust/jobs/src/lib.rs | 313 +++++++++++++------------ record.txt | 1 + 3 files changed, 161 insertions(+), 155 deletions(-) diff --git a/bash-5.1/builtins_rust/jobs/Cargo.toml b/bash-5.1/builtins_rust/jobs/Cargo.toml index fa26bda5..d07d3572 100644 --- a/bash-5.1/builtins_rust/jobs/Cargo.toml +++ b/bash-5.1/builtins_rust/jobs/Cargo.toml @@ -2,7 +2,7 @@ authors = ["huzhengming"] name = "rjobs" version = "0.0.1" -build = "../build.rs" +build = "build.rs" edition = "2021" diff --git a/bash-5.1/builtins_rust/jobs/src/lib.rs b/bash-5.1/builtins_rust/jobs/src/lib.rs index eb703d85..9b8a9a7a 100644 --- a/bash-5.1/builtins_rust/jobs/src/lib.rs +++ b/bash-5.1/builtins_rust/jobs/src/lib.rs @@ -1,7 +1,7 @@ extern crate libc; extern crate nix; -use libc::{c_char, c_long}; +use libc::{F_UNLCK, c_char, c_long}; use std::ffi::CString; #[repr(C)] @@ -31,7 +31,6 @@ enum command_type { cm_for, cm_case, cm_while, cm_if, cm_simple, cm_select, cm_connection, cm_function_def, cm_until, cm_group, cm_arith, cm_cond, cm_arith_for, cm_subshell, cm_coproc } - #[repr(u8)] #[derive(Copy,Clone)] enum r_instruction { @@ -42,8 +41,7 @@ enum r_instruction { r_duplicating_input_word, r_duplicating_output_word, r_move_input, r_move_output, r_move_input_word, r_move_output_word, r_append_err_and_out -} - + } #[repr(C)] pub struct PROCESS { next: *mut PROCESS, @@ -71,6 +69,7 @@ pub union REDIRECT { here_doc_eof:*mut c_char /* The word that appeared in < {3} } - #[macro_export] macro_rules! EXECUTION_FAILURE { () => {1} } - #[macro_export] macro_rules! JSTATE_RUNNING { () => {0x1} } - #[macro_export] macro_rules! JSTATE_STOPPED { () => {0x2} } - #[macro_export] macro_rules! EX_USAGE { () => {258} } - #[macro_export] macro_rules! EXECUTION_SUCCESS { () => {0} } - #[macro_export] macro_rules! BLOCK_SIGNAL { - ($sig:expr, $nvar:expr, $ovar:expr) => { + ($sig:expr, $nvar:expr, $ovar:expr) => { $nvar.unwrap().clear(); $nvar.unwrap().add($sig); $nvar.unwrap().clear(); - nix::sys::signal::sigprocmask(nix::sys::signal::SigmaskHow::SIG_BLOCK, $nvar, $ovar); + nix::sys::signal::sigprocmask(nix::sys::signal::SigmaskHow::SIG_BLOCK, $nvar, $ovar); } } @@ -322,18 +317,17 @@ macro_rules! UNBLOCK_SIGNAL { nix::sys::signal::sigprocmask(nix::sys::signal::SigmaskHow::SIG_SETMASK, $ovar, None) } } - #[macro_export] macro_rules! UNBLOCK_CHILD { ($ovar:expr) => { - UNBLOCK_SIGNAL!($ovar); + UNBLOCK_SIGNAL!($ovar); } } #[macro_export] macro_rules! BLOCK_CHILD { ($nvar:expr,$ovar:expr) => { - BLOCK_SIGNAL!(nix::sys::signal::SIGCHLD, $nvar, $ovar); + BLOCK_SIGNAL!(nix::sys::signal::SIGCHLD, $nvar, $ovar); } } @@ -346,7 +340,6 @@ macro_rules! NO_JOB { macro_rules! DUP_JOB { () => {-2} } - #[macro_export] macro_rules! CMD_INHIBIT_EXPANSION {/* Do not expand the command words. */ () => {0x20} @@ -355,14 +348,14 @@ macro_rules! CMD_INHIBIT_EXPANSION {/* Do not expand the command words. */ #[macro_export] macro_rules! get_job_by_jid { ($ind:expr) => { - (*((jobs as usize + ($ind*32) as usize ) as *mut*mut JOB) as *mut JOB) + (*(((jobs as i32) + $ind*8 ) as *mut*mut JOB) as *mut JOB) } } #[macro_export] macro_rules! INVALID_JOB { ($j:expr) => { - $j <0 || $j >= js.j_jobslots || get_job_by_jid !($j) == std::ptr::null_mut() + $j <0 || $j >= js.j_jobslots || get_job_by_jid !($j) as u8 == 0 } } @@ -372,14 +365,15 @@ extern "C" { fn internal_getopt (list:*mut WORD_LIST , opts:*mut c_char)->i32; fn builtin_error(err:*const c_char,...); fn builtin_usage(); - static mut loptend:*mut WORD_LIST; + static mut loptend:*mut WORD_LIST; fn list_all_jobs(form:i32); fn list_stopped_jobs(form:i32); - fn list_one_job (jjob:*mut JOB, format:i32, ignore:i32, job_index:i32); + fn list_one_job (jjob:*mut JOB, format:i32, ignore:i32, job_index:i32); fn get_job_spec (list:*mut WORD_LIST)->i32; fn sh_badjob (str:*mut c_char); static jobs:*mut*mut JOB; - fn discard_unwind_frame (str: * mut c_char); + fn discard_unwind_frame (str: * mut c_char); + fn begin_unwind_frame (str: * mut c_char); fn execute_command (command:* mut COMMAND)->i32; fn dispose_command (command:* mut COMMAND); @@ -394,32 +388,35 @@ extern "C" { fn nohup_all_jobs (running_only:i32); fn delete_all_jobs(running_only:i32); } - #[no_mangle] pub extern "C" fn r_execute_list_with_replacements (list:*mut WORD_LIST)->i32{ - //println!("r_execute_list_with_replacements"); + println!("r_execute_list_with_replacements"); unsafe{ - let mut l:*mut WORD_LIST=list; + let mut l:WORD_LIST=WORD_LIST{next:list,word:(*list).word}; let mut job:i32; let result:i32; let command:*mut COMMAND; - - /* First do the replacement of job specifications with pids. */ - while l !=std::ptr::null_mut() { - let lchar:char=char::from((*(*(*l).word).word) as u8); + + + /* First do the replacement of job specifications with pids. */ + + while l.next as u8 !=0 { + let lchar:char=char::from((*(*l.word).word) as u8); if lchar== '%' /* we have a winner */ { - job = get_job_spec ( l); + job = get_job_spec (&mut l); + /* A bad job spec is not really a job spec! Pass it through. */ if INVALID_JOB!(job){ continue; } - libc::free((*(*l).word).word as * mut libc::c_void); - (*(*(*l).word).word) = (*get_job_by_jid! (job)).pgrp as i8; - } - l=(*l).next; - } - + libc::free((*l.word).word as * mut libc::c_void); + (*(*l.word).word) = (*get_job_by_jid! (job)).pgrp as i8; + } + l=*(l.next); + } + + let mut c_str_jobs_builtin = CString::new("jobs_builtin").unwrap(); /* Next make a new simple command and execute it. */ begin_unwind_frame (c_str_jobs_builtin.as_ptr() as * mut c_char); @@ -433,14 +430,15 @@ extern "C" { add_unwind_protect(dispose_command, command); result = execute_command (command); dispose_command (command); + discard_unwind_frame (c_str_jobs_builtin.as_ptr() as * mut c_char); return result; } } #[no_mangle] -pub extern "C" fn r_jobs_builtin(list:*mut WORD_LIST)->i32 { - //println!("r_jobs_builtin"); +pub extern "C" fn r_jobs_builtin(list:*mut WORD_LIST)->i32{ + println!("r_jobs_builtin"); let mut form:i32; let mut execute:i32=0; let mut state:i32; @@ -455,41 +453,44 @@ pub extern "C" fn r_jobs_builtin(list:*mut WORD_LIST)->i32 { state = JSTATE_ANY!(); unsafe { - reset_internal_getopt(); - - let mut c_str_lpnxrs = CString::new("lpnxrs").unwrap(); // from a &str, creates a new allocation - - opt = internal_getopt (list, c_str_lpnxrs.as_ptr() as * mut c_char); - while opt != -1 { - let optu8:u8= opt as u8; - let optChar:char=char::from(optu8); - match optChar{ - 'l'=>{form = JLIST_LONG!();} - 'p'=>{form = JLIST_PID_ONLY!();} - 'n'=>{form = JLIST_CHANGED_ONLY!();} - 'x'=>{ - if form != JLIST_STANDARD!() { - let mut c_str_err = CString::new("no other options allowed with `-x'").unwrap(); // from a &str, creates a new allocation - builtin_error (c_str_err.as_ptr()); - return EXECUTION_FAILURE!(); + reset_internal_getopt(); + + let mut c_str_lpnxrs = CString::new("lpnxrs").unwrap(); // from a &str, creates a new allocation + + opt = internal_getopt (list, c_str_lpnxrs.as_ptr() as * mut c_char); + while opt != -1{ + let optu8:u8= opt as u8; + let optChar:char=char::from(optu8); + match optChar{ + 'l'=>{form = JLIST_LONG!();} + 'p'=>{form = JLIST_PID_ONLY!();} + 'n'=>{form = JLIST_CHANGED_ONLY!();} + 'x'=>{ + if form != JLIST_STANDARD!() { + let mut c_str_err = CString::new("no other options allowed with `-x'").unwrap(); // from a &str, creates a new allocation + builtin_error (c_str_err.as_ptr()); + return EXECUTION_FAILURE!(); + } + execute+=1; } - execute+=1; + 'r'=>{state = JSTATE_RUNNING!();} + 's'=>{state = JSTATE_STOPPED!();} + + _=>{ + builtin_usage (); + return EX_USAGE!(); } - 'r'=>{state = JSTATE_RUNNING!();} - 's'=>{state = JSTATE_STOPPED!();} - _=>{ - builtin_usage (); - return EX_USAGE!(); - } + + } + opt = internal_getopt (list, c_str_lpnxrs.as_ptr() as * mut c_char); } - opt = internal_getopt (list, c_str_lpnxrs.as_ptr() as * mut c_char); - } - if execute != 0 { - return r_execute_list_with_replacements (loptend); - } - if loptend ==std::ptr::null_mut() { + if execute != 0 { + return r_execute_list_with_replacements (loptend); + } + + if loptend as u8 ==0 { if state == JSTATE_ANY!() { list_all_jobs (form); } else if state == JSTATE_RUNNING!() { @@ -499,32 +500,30 @@ pub extern "C" fn r_jobs_builtin(list:*mut WORD_LIST)->i32 { } return EXECUTION_SUCCESS!(); } - - let mut loptendt=*loptend; - while loptendt.next !=std::ptr::null_mut() { + + while loptend as u8 !=0 { BLOCK_CHILD !(Some(&mut set), Some(&mut oset)); - job = get_job_spec (&mut loptendt); + job = get_job_spec (loptend); - if (job == NO_JOB!()) || jobs == std::ptr::null_mut() || get_job_by_jid !(job) == std::ptr::null_mut() { - sh_badjob ((*loptendt.word).word); + if (job == NO_JOB!()) || jobs as u8 == 0 || get_job_by_jid !(job) as u8 == 0 { + sh_badjob ((*(*loptend).word).word); any_failed+=1; - } else if (job != DUP_JOB!()) { + } else if (job != DUP_JOB!()){ list_one_job (0 as * mut JOB, form, 0, job); } UNBLOCK_CHILD !(Some(&oset)); - loptendt = *loptendt.next; + loptend = (*loptend).next; } if any_failed !=0 { return EXECUTION_FAILURE!(); - } else { + }else { return EXECUTION_SUCCESS!(); } } } - #[no_mangle] -pub extern "C" fn r_disown_builtin (list:* mut WORD_LIST)->libc::c_int { +pub extern "C" fn r_disown_builtin (list:* mut WORD_LIST)->libc::c_int{ let opt:i32; let mut job:i32=0; let mut retval:i32; @@ -535,89 +534,95 @@ pub extern "C" fn r_disown_builtin (list:* mut WORD_LIST)->libc::c_int { let mut set:nix::sys::signal::SigSet=nix::sys::signal::SigSet::empty(); let mut oset:nix::sys::signal::SigSet =nix::sys::signal::SigSet::empty(); let mut pid_value:c_long=0; - //println!("r_disown_builtin"); + println!("r_disown_builtin"); unsafe { reset_internal_getopt (); let mut c_str_ahr = CString::new("ahr").unwrap(); // from a &str, creates a new allocation + opt = internal_getopt (list, c_str_ahr.as_ptr() as * mut c_char); - while opt != -1 { + while opt != -1{ let optu8:u8= opt as u8; let optChar:char=char::from(optu8); match optChar{ - 'a'=>{all_jobs = 1;} - 'h'=>{nohup_only = 1;} - 'r'=>{running_jobs = 1;} - _=>{ - builtin_usage (); - return EX_USAGE!(); - } + 'a'=>{all_jobs = 1;} + 'h'=>{nohup_only = 1;} + 'r'=>{running_jobs = 1;} + _=>{ + builtin_usage (); + return EX_USAGE!(); + } + } - } - + } + retval = EXECUTION_SUCCESS!(); /* `disown -a' or `disown -r' */ - if loptend == std::ptr::null_mut() && (all_jobs !=0 || running_jobs != 0) { + if loptend as u8 == 0 && (all_jobs !=0 || running_jobs != 0) { if nohup_only!=0{ nohup_all_jobs (running_jobs); - } else { + } else{ delete_all_jobs (running_jobs); } - return EXECUTION_SUCCESS!(); - } - - BLOCK_CHILD !(Some(&mut set), Some(&mut oset)); - if (loptend !=std::ptr::null_mut() && legal_number ((*(*loptend).word).word, &mut pid_value) !=0 && pid_value == pid_value) { - job=get_job_by_pid ( pid_value as i32, 0, 0 as *mut*mut PROCESS); - }else { - get_job_spec (loptend); - } - if job == NO_JOB!() || jobs !=std::ptr::null_mut() || INVALID_JOB!(job) { - if loptend !=std::ptr::null_mut() { + + return EXECUTION_SUCCESS!(); + } + + BLOCK_CHILD !(Some(&mut set), Some(&mut oset)); + if (loptend as u8 !=0 && legal_number ((*(*loptend).word).word, &mut pid_value) !=0 && pid_value == pid_value) { + job=get_job_by_pid ( pid_value as i32, 0, 0 as *mut*mut PROCESS); + }else { + get_job_spec (loptend); + + } + if job == NO_JOB!() || jobs as u8 !=0 || INVALID_JOB!(job){ + if loptend as u8 !=0 { sh_badjob ((*(*loptend).word).word); - } else { + }else { sh_badjob (CString::new("current").unwrap().as_ptr() as * mut c_char); - } - retval = EXECUTION_FAILURE!(); - } else if nohup_only !=0{ + } + retval = EXECUTION_FAILURE!(); + } else if nohup_only !=0{ nohup_job (job); } else { delete_job (job, 1); } + + UNBLOCK_CHILD !(Some(&oset)); - UNBLOCK_CHILD !(Some(&oset)); - - if loptend != std::ptr::null_mut() { - let mut loptendt=*loptend; - while loptendt.next !=std::ptr::null_mut() { - loptendt = *loptendt.next; - BLOCK_CHILD !(Some(&mut set), Some(&mut oset)); - if legal_number ((*loptendt.word).word, &mut pid_value) !=0 && pid_value == pid_value { - job=get_job_by_pid ( pid_value as i32, 0, 0 as *mut*mut PROCESS); - } else { - get_job_spec (&mut loptendt); - } - if job == NO_JOB!() || jobs !=std::ptr::null_mut() || INVALID_JOB!(job) { - sh_badjob ((*loptendt.word).word); - retval = EXECUTION_FAILURE!(); - } else if nohup_only !=0{ - nohup_job (job); - } else { - delete_job (job, 1); - } - UNBLOCK_CHILD !(Some(&oset)); + if loptend as u8 !=0{ + loptend = (*loptend).next; + } + + + while loptend as u8 !=0 { + BLOCK_CHILD !(Some(&mut set), Some(&mut oset)); + if (loptend as u8 !=0 && legal_number ((*(*loptend).word).word, &mut pid_value) !=0 && pid_value == pid_value) { + job=get_job_by_pid ( pid_value as i32, 0, 0 as *mut*mut PROCESS); + }else { + get_job_spec (loptend); + } + if job == NO_JOB!() || jobs as u8 !=0 || INVALID_JOB!(job){ + if loptend as u8 !=0 { + sh_badjob ((*(*loptend).word).word); + }else { + sh_badjob (CString::new("current").unwrap().as_ptr() as * mut c_char); + } + retval = EXECUTION_FAILURE!(); + } else if nohup_only !=0{ + nohup_job (job); + } else { + delete_job (job, 1); + } + + UNBLOCK_CHILD !(Some(&oset)); + + if loptend as u8 !=0{ + loptend = (*loptend).next; + } } + return retval; } -} - -#[no_mangle] -pub extern "C" fn cmd_name() ->*const u8 { - return b"jobs" as *const u8; -} - -#[no_mangle] -pub extern "C" fn run(list : *mut WORD_LIST)->i32 { - return r_jobs_builtin(list); } \ No newline at end of file diff --git a/record.txt b/record.txt index b49e1f80..03a89765 100644 --- a/record.txt +++ b/record.txt @@ -18,3 +18,4 @@ 12 13 14 +15 -- Gitee From 7ec4ffec0176ed681c37adc78f954bb6fe0032d0 Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Wed, 14 Jun 2023 11:05:06 +0800 Subject: [PATCH 09/12] builtins_rust: add read plugin --- bash-5.1/.gitignore | 1 + bash-5.1/Cargo.toml | 1 + bash-5.1/builtins/read.def | 1074 +----------------------- bash-5.1/builtins_rust/jobs/Cargo.toml | 2 +- record.txt | 1 + 5 files changed, 8 insertions(+), 1071 deletions(-) diff --git a/bash-5.1/.gitignore b/bash-5.1/.gitignore index 6c7dbc5f..4c50e886 100644 --- a/bash-5.1/.gitignore +++ b/bash-5.1/.gitignore @@ -1,4 +1,5 @@ *.swp tags +Cargo.lock target/ .vscode diff --git a/bash-5.1/Cargo.toml b/bash-5.1/Cargo.toml index ec2f4f94..3c97c62e 100644 --- a/bash-5.1/Cargo.toml +++ b/bash-5.1/Cargo.toml @@ -10,3 +10,4 @@ members = ["builtins/command1", "builtins/command2"] [dependencies] command1 = {path = "./builtins/command1"} command2 = {path = "./builtins/command2"} +read = {path = "./builtins_rust/read"} diff --git a/bash-5.1/builtins/read.def b/bash-5.1/builtins/read.def index 39e16e84..6e1f5375 100644 --- a/bash-5.1/builtins/read.def +++ b/bash-5.1/builtins/read.def @@ -1,23 +1,3 @@ -This file is read.def, from which is created read.c. -It implements the builtin "read" in Bash. - -Copyright (C) 1987-2020 Free Software Foundation, Inc. - -This file is part of GNU Bash, the Bourne Again SHell. - -Bash is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Bash is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Bash. If not, see . - $PRODUCES read.c $BUILTIN read @@ -112,59 +92,11 @@ $END extern int errno; #endif -struct ttsave -{ - int fd; - TTYSTRUCT attrs; -}; - -#if defined (READLINE) -static void reset_attempted_completion_function PARAMS((char *)); -static int set_itext PARAMS((void)); -static char *edit_line PARAMS((char *, char *)); -static void set_eol_delim PARAMS((int)); -static void reset_eol_delim PARAMS((char *)); -#endif -static SHELL_VAR *bind_read_variable PARAMS((char *, char *)); -#if defined (HANDLE_MULTIBYTE) -static int read_mbchar PARAMS((int, char *, int, int, int)); -#endif -static void ttyrestore PARAMS((struct ttsave *)); - -static sighandler sigalrm PARAMS((int)); -static void reset_alarm PARAMS((void)); +extern int r_read_builtin (WORD_LIST *); -/* Try this to see what the rest of the shell can do with the information. */ procenv_t alrmbuf; int sigalrm_seen; -static int reading, tty_modified; -static SigHandler *old_alrm; -static unsigned char delim; - -static struct ttsave termsave; - -/* In all cases, SIGALRM just sets a flag that we check periodically. This - avoids problems with the semi-tricky stuff we do with the xfree of - input_string at the top of the unwind-protect list (see below). */ - -/* Set a flag that CHECK_ALRM can check. This relies on zread or read_builtin - calling trap.c:check_signals(), which knows about sigalrm_seen and alrmbuf. */ -static sighandler -sigalrm (s) - int s; -{ - sigalrm_seen = 1; -} - -static void -reset_alarm () -{ - /* Cancel alarm before restoring signal handler. */ - falarm (0, 0); - set_signal_handler (SIGALRM, old_alrm); -} - /* Read the value of the shell variables whose names follow. The reading is done from the current input stream, whatever that may be. Successive words of the input line are assigned @@ -175,1016 +107,18 @@ int read_builtin (list) WORD_LIST *list; { - register char *varname; - int size, nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2, nflag; - volatile int i; - int input_is_tty, input_is_pipe, unbuffered_read, skip_ctlesc, skip_ctlnul; - int raw, edit, nchars, silent, have_timeout, ignore_delim, fd; - int lastsig, t_errno; - int mb_cur_max; - unsigned int tmsec, tmusec; - long ival, uval; - intmax_t intval; - char c; - char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname; - char *e, *t, *t1, *ps2, *tofree; - struct stat tsb; - SHELL_VAR *var; - TTYSTRUCT ttattrs, ttset; -#if defined (ARRAY_VARS) - WORD_LIST *alist; - int vflags; -#endif -#if defined (READLINE) - char *rlbuf, *itext; - int rlind; - FILE *save_instream; -#endif - - USE_VAR(size); - USE_VAR(i); - USE_VAR(pass_next); - USE_VAR(print_ps2); - USE_VAR(saw_escape); - USE_VAR(input_is_pipe); -/* USE_VAR(raw); */ - USE_VAR(edit); - USE_VAR(tmsec); - USE_VAR(tmusec); - USE_VAR(nchars); - USE_VAR(silent); - USE_VAR(ifs_chars); - USE_VAR(prompt); - USE_VAR(arrayname); -#if defined (READLINE) - USE_VAR(rlbuf); - USE_VAR(rlind); - USE_VAR(itext); -#endif - USE_VAR(list); - USE_VAR(ps2); - USE_VAR(lastsig); - - sigalrm_seen = reading = tty_modified = 0; - - i = 0; /* Index into the string that we are reading. */ - raw = edit = 0; /* Not reading raw input by default. */ - silent = 0; - arrayname = prompt = (char *)NULL; - fd = 0; /* file descriptor to read from */ - -#if defined (READLINE) - rlbuf = itext = (char *)0; - rlind = 0; -#endif - - mb_cur_max = MB_CUR_MAX; - tmsec = tmusec = 0; /* no timeout */ - nr = nchars = input_is_tty = input_is_pipe = unbuffered_read = have_timeout = 0; - delim = '\n'; /* read until newline */ - ignore_delim = nflag = 0; - - reset_internal_getopt (); - while ((opt = internal_getopt (list, "ersa:d:i:n:p:t:u:N:")) != -1) - { - switch (opt) - { - case 'r': - raw = 1; - break; - case 'p': - prompt = list_optarg; - break; - case 's': - silent = 1; - break; - case 'e': -#if defined (READLINE) - edit = 1; -#endif - break; - case 'i': -#if defined (READLINE) - itext = list_optarg; -#endif - break; -#if defined (ARRAY_VARS) - case 'a': - arrayname = list_optarg; - break; -#endif - case 't': - code = uconvert (list_optarg, &ival, &uval, (char **)NULL); - if (code == 0 || ival < 0 || uval < 0) - { - builtin_error (_("%s: invalid timeout specification"), list_optarg); - return (EXECUTION_FAILURE); - } - else - { - have_timeout = 1; - tmsec = ival; - tmusec = uval; - } - break; - case 'N': - ignore_delim = 1; - delim = -1; - case 'n': - nflag = 1; - code = legal_number (list_optarg, &intval); - if (code == 0 || intval < 0 || intval != (int)intval) - { - sh_invalidnum (list_optarg); - return (EXECUTION_FAILURE); - } - else - nchars = intval; - break; - case 'u': - code = legal_number (list_optarg, &intval); - if (code == 0 || intval < 0 || intval != (int)intval) - { - builtin_error (_("%s: invalid file descriptor specification"), list_optarg); - return (EXECUTION_FAILURE); - } - else - fd = intval; - if (sh_validfd (fd) == 0) - { - builtin_error (_("%d: invalid file descriptor: %s"), fd, strerror (errno)); - return (EXECUTION_FAILURE); - } - break; - case 'd': - delim = *list_optarg; - break; - CASE_HELPOPT; - default: - builtin_usage (); - return (EX_USAGE); - } - } - list = loptend; - - /* `read -t 0 var' tests whether input is available with select/FIONREAD, - and fails if those are unavailable */ - if (have_timeout && tmsec == 0 && tmusec == 0) -#if 0 - return (EXECUTION_FAILURE); -#else - return (input_avail (fd) ? EXECUTION_SUCCESS : EXECUTION_FAILURE); -#endif - - /* Convenience: check early whether or not the first of possibly several - variable names is a valid identifier, and bail early if so. */ -#if defined (ARRAY_VARS) - vflags = assoc_expand_once ? (VA_NOEXPAND|VA_ONEWORD) : 0; - if (list && legal_identifier (list->word->word) == 0 && valid_array_reference (list->word->word, vflags) == 0) -#else - if (list && legal_identifier (list->word->word) == 0) -#endif - { - sh_invalidid (list->word->word); - return (EXECUTION_FAILURE); - } - - /* If we're asked to ignore the delimiter, make sure we do. */ - if (ignore_delim) - delim = -1; - - /* IF IFS is unset, we use the default of " \t\n". */ - ifs_chars = getifs (); - if (ifs_chars == 0) /* XXX - shouldn't happen */ - ifs_chars = ""; - /* If we want to read exactly NCHARS chars, don't split on IFS */ - if (ignore_delim) - ifs_chars = ""; - for (skip_ctlesc = skip_ctlnul = 0, e = ifs_chars; *e; e++) - skip_ctlesc |= *e == CTLESC, skip_ctlnul |= *e == CTLNUL; - - input_string = (char *)xmalloc (size = 112); /* XXX was 128 */ - input_string[0] = '\0'; - - /* More input and options validation */ - if (nflag == 1 && nchars == 0) - { - retval = read (fd, &c, 0); - retval = (retval >= 0) ? EXECUTION_SUCCESS : EXECUTION_FAILURE; - goto assign_vars; /* bail early if asked to read 0 chars */ - } - - /* $TMOUT, if set, is the default timeout for read. */ - if (have_timeout == 0 && (e = get_string_value ("TMOUT"))) - { - code = uconvert (e, &ival, &uval, (char **)NULL); - if (code == 0 || ival < 0 || uval < 0) - tmsec = tmusec = 0; - else - { - tmsec = ival; - tmusec = uval; - } - } - - begin_unwind_frame ("read_builtin"); - -#if defined (BUFFERED_INPUT) - if (interactive == 0 && default_buffered_input >= 0 && fd_is_bash_input (fd)) - sync_buffered_stream (default_buffered_input); -#endif - -#if 1 - input_is_tty = isatty (fd); -#else - input_is_tty = 1; -#endif - if (input_is_tty == 0) -#ifndef __CYGWIN__ - input_is_pipe = (lseek (fd, 0L, SEEK_CUR) < 0) && (errno == ESPIPE); -#else - input_is_pipe = 1; -#endif - - /* If the -p, -e or -s flags were given, but input is not coming from the - terminal, turn them off. */ - if ((prompt || edit || silent) && input_is_tty == 0) - { - prompt = (char *)NULL; -#if defined (READLINE) - itext = (char *)NULL; -#endif - edit = silent = 0; - } - -#if defined (READLINE) - if (edit) - add_unwind_protect (xfree, rlbuf); -#endif - - pass_next = 0; /* Non-zero signifies last char was backslash. */ - saw_escape = 0; /* Non-zero signifies that we saw an escape char */ - - if (tmsec > 0 || tmusec > 0) - { - /* Turn off the timeout if stdin is a regular file (e.g. from - input redirection). */ - if ((fstat (fd, &tsb) < 0) || S_ISREG (tsb.st_mode)) - tmsec = tmusec = 0; - } - - if (tmsec > 0 || tmusec > 0) - { - code = setjmp_nosigs (alrmbuf); - if (code) - { - sigalrm_seen = 0; - /* Tricky. The top of the unwind-protect stack is the free of - input_string. We want to run all the rest and use input_string, - so we have to save input_string temporarily, run the unwind- - protects, then restore input_string so we can use it later */ - orig_input_string = 0; - input_string[i] = '\0'; /* make sure it's terminated */ - if (i == 0) - { - t = (char *)xmalloc (1); - t[0] = 0; - } - else - t = savestring (input_string); - - run_unwind_frame ("read_builtin"); - input_string = t; - retval = 128+SIGALRM; - goto assign_vars; - } - if (interactive_shell == 0) - initialize_terminating_signals (); - old_alrm = set_signal_handler (SIGALRM, sigalrm); - add_unwind_protect (reset_alarm, (char *)NULL); -#if defined (READLINE) - if (edit) - { - add_unwind_protect (reset_attempted_completion_function, (char *)NULL); - add_unwind_protect (bashline_reset_event_hook, (char *)NULL); - } -#endif - falarm (tmsec, tmusec); - } - - /* If we've been asked to read only NCHARS chars, or we're using some - character other than newline to terminate the line, do the right - thing to readline or the tty. */ - if (nchars > 0 || delim != '\n') - { -#if defined (READLINE) - if (edit) - { - if (nchars > 0) - { - unwind_protect_int (rl_num_chars_to_read); - rl_num_chars_to_read = nchars; - } - if (delim != '\n') - { - set_eol_delim (delim); - add_unwind_protect (reset_eol_delim, (char *)NULL); - } - } - else -#endif - if (input_is_tty) - { - /* ttsave() */ - termsave.fd = fd; - ttgetattr (fd, &ttattrs); - termsave.attrs = ttattrs; - - ttset = ttattrs; - i = silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset); - if (i < 0) - sh_ttyerror (1); - tty_modified = 1; - add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); - if (interactive_shell == 0) - initialize_terminating_signals (); - } - } - else if (silent) /* turn off echo but leave term in canonical mode */ - { - /* ttsave (); */ - termsave.fd = fd; - ttgetattr (fd, &ttattrs); - termsave.attrs = ttattrs; - - ttset = ttattrs; - i = ttfd_noecho (fd, &ttset); /* ttnoecho (); */ - if (i < 0) - sh_ttyerror (1); - - tty_modified = 1; - add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); - if (interactive_shell == 0) - initialize_terminating_signals (); - } - -#if defined (READLINE) - save_instream = 0; - if (edit && fd != 0) - { - if (bash_readline_initialized == 0) - initialize_readline (); - - unwind_protect_var (rl_instream); - save_instream = rl_instream; - rl_instream = fdopen (fd, "r"); - } -#endif - - /* This *must* be the top unwind-protect on the stack, so the manipulation - of the unwind-protect stack after the realloc() works right. */ - add_unwind_protect (xfree, input_string); - - CHECK_ALRM; - if ((nchars > 0) && (input_is_tty == 0) && ignore_delim) /* read -N */ - unbuffered_read = 2; - else if ((nchars > 0) || (delim != '\n') || input_is_pipe) - unbuffered_read = 1; - - if (prompt && edit == 0) - { - fprintf (stderr, "%s", prompt); - fflush (stderr); - } - -#if defined (__CYGWIN__) && defined (O_TEXT) - setmode (0, O_TEXT); -#endif - - ps2 = 0; - for (print_ps2 = eof = retval = 0;;) - { - CHECK_ALRM; - -#if defined (READLINE) - if (edit) - { - /* If we have a null delimiter, don't treat NULL as ending the line */ - if (rlbuf && rlbuf[rlind] == '\0' && delim != '\0') - { - free (rlbuf); - rlbuf = (char *)0; - } - if (rlbuf == 0) - { - reading = 1; - rlbuf = edit_line (prompt ? prompt : "", itext); - reading = 0; - rlind = 0; - } - if (rlbuf == 0) - { - eof = 1; - break; - } - c = rlbuf[rlind++]; - } - else - { -#endif - - if (print_ps2) - { - if (ps2 == 0) - ps2 = get_string_value ("PS2"); - fprintf (stderr, "%s", ps2 ? ps2 : ""); - fflush (stderr); - print_ps2 = 0; - } - - reading = 1; - CHECK_ALRM; - errno = 0; - if (unbuffered_read == 2) - retval = posixly_correct ? zreadintr (fd, &c, 1) : zreadn (fd, &c, nchars - nr); - else if (unbuffered_read) - retval = posixly_correct ? zreadintr (fd, &c, 1) : zread (fd, &c, 1); - else - retval = posixly_correct ? zreadcintr (fd, &c) : zreadc (fd, &c); - reading = 0; - - if (retval <= 0) - { - int t; - - t = errno; - if (retval < 0 && errno == EINTR) - { - check_signals (); /* in case we didn't call zread via zreadc */ - lastsig = LASTSIG(); - if (lastsig == 0) - lastsig = trapped_signal_received; -#if 0 - run_pending_traps (); /* because interrupt_immediately is not set */ -#endif - } - else - lastsig = 0; - if (terminating_signal && tty_modified) - ttyrestore (&termsave); /* fix terminal before exiting */ - CHECK_TERMSIG; - eof = 1; - errno = t; /* preserve it for the error message below */ - break; - } - - QUIT; /* in case we didn't call check_signals() */ -#if defined (READLINE) - } -#endif - - if (retval <= 0) /* XXX shouldn't happen */ - CHECK_ALRM; - - /* XXX -- use i + mb_cur_max (at least 4) for multibyte/read_mbchar */ - if (i + (mb_cur_max > 4 ? mb_cur_max : 4) >= size) - { - char *t; - t = (char *)xrealloc (input_string, size += 128); - - /* Only need to change unwind-protect if input_string changes */ - if (t != input_string) - { - input_string = t; - remove_unwind_protect (); - add_unwind_protect (xfree, input_string); - } - } - - /* If the next character is to be accepted verbatim, a backslash - newline pair still disappears from the input. */ - if (pass_next) - { - pass_next = 0; - if (c == '\n') - { - if (skip_ctlesc == 0 && i > 0) - i--; /* back up over the CTLESC */ - if (interactive && input_is_tty && raw == 0) - print_ps2 = 1; - } - else - goto add_char; - continue; - } - - /* This may cause problems if IFS contains CTLESC */ - if (c == '\\' && raw == 0) - { - pass_next++; - if (skip_ctlesc == 0) - { - saw_escape++; - input_string[i++] = CTLESC; - } - continue; - } - - if (ignore_delim == 0 && (unsigned char)c == delim) - break; - - if (c == '\0' && delim != '\0') - continue; /* skip NUL bytes in input */ - - if ((skip_ctlesc == 0 && c == CTLESC) || (skip_ctlnul == 0 && c == CTLNUL)) - { - saw_escape++; - input_string[i++] = CTLESC; - } - -add_char: - input_string[i++] = c; - CHECK_ALRM; - -#if defined (HANDLE_MULTIBYTE) - /* XXX - what if C == 127? Can DEL introduce a multibyte sequence? */ - if (mb_cur_max > 1 && is_basic (c) == 0) - { - input_string[i] = '\0'; /* for simplicity and debugging */ - /* If we got input from readline, grab the next multibyte char from - rlbuf. */ -# if defined (READLINE) - if (edit) - { - size_t clen; - clen = mbrlen (rlbuf + rlind - 1, mb_cur_max, (mbstate_t *)NULL); - /* We only deal with valid multibyte sequences longer than one - byte. If we get anything else, we leave the one character - copied and move on to the next. */ - if ((int)clen > 1) - { - memcpy (input_string+i, rlbuf+rlind, clen-1); - i += clen - 1; - rlind += clen - 1; - } - } - else -# endif - if (locale_utf8locale == 0 || ((c & 0x80) != 0)) - i += read_mbchar (fd, input_string, i, c, unbuffered_read); - } -#endif - - nr++; - - if (nchars > 0 && nr >= nchars) - break; - } - input_string[i] = '\0'; - CHECK_ALRM; - -#if defined (READLINE) - if (edit) - free (rlbuf); -#endif - - if (retval < 0) - { - t_errno = errno; - if (errno != EINTR) - builtin_error (_("read error: %d: %s"), fd, strerror (errno)); - run_unwind_frame ("read_builtin"); - return ((t_errno != EINTR) ? EXECUTION_FAILURE : 128+lastsig); - } - - if (tmsec > 0 || tmusec > 0) - reset_alarm (); - - if (nchars > 0 || delim != '\n') - { -#if defined (READLINE) - if (edit) - { - if (nchars > 0) - rl_num_chars_to_read = 0; - if (delim != '\n') - reset_eol_delim ((char *)NULL); - } - else -#endif - if (input_is_tty) - ttyrestore (&termsave); - } - else if (silent) - ttyrestore (&termsave); - - if (unbuffered_read == 0) - zsyncfd (fd); - -#if defined (READLINE) - if (save_instream) - rl_instream = save_instream; /* can't portably free it */ -#endif - - discard_unwind_frame ("read_builtin"); - - retval = eof ? EXECUTION_FAILURE : EXECUTION_SUCCESS; - -assign_vars: - -#if defined (ARRAY_VARS) - /* If -a was given, take the string read, break it into a list of words, - an assign them to `arrayname' in turn. */ - if (arrayname) - { - if (legal_identifier (arrayname) == 0) - { - sh_invalidid (arrayname); - free (input_string); - return (EXECUTION_FAILURE); - } - - var = find_or_make_array_variable (arrayname, 1); - if (var == 0) - { - free (input_string); - return EXECUTION_FAILURE; /* readonly or noassign */ - } - if (assoc_p (var)) - { - builtin_error (_("%s: cannot convert associative to indexed array"), arrayname); - free (input_string); - return EXECUTION_FAILURE; /* existing associative array */ - } - else if (invisible_p (var)) - VUNSETATTR (var, att_invisible); - array_flush (array_cell (var)); - - alist = list_string (input_string, ifs_chars, 0); - if (alist) - { - if (saw_escape) - dequote_list (alist); - else - word_list_remove_quoted_nulls (alist); - assign_array_var_from_word_list (var, alist, 0); - dispose_words (alist); - } - free (input_string); - return (retval); - } -#endif /* ARRAY_VARS */ - - /* If there are no variables, save the text of the line read to the - variable $REPLY. ksh93 strips leading and trailing IFS whitespace, - so that `read x ; echo "$x"' and `read ; echo "$REPLY"' behave the - same way, but I believe that the difference in behaviors is useful - enough to not do it. Without the bash behavior, there is no way - to read a line completely without interpretation or modification - unless you mess with $IFS (e.g., setting it to the empty string). - If you disagree, change the occurrences of `#if 0' to `#if 1' below. */ - if (list == 0) - { -#if 0 - orig_input_string = input_string; - for (t = input_string; ifs_chars && *ifs_chars && spctabnl(*t) && isifs(*t); t++) - ; - input_string = t; - input_string = strip_trailing_ifs_whitespace (input_string, ifs_chars, saw_escape); -#endif - - if (saw_escape) - { - t = dequote_string (input_string); - var = bind_variable ("REPLY", t, 0); - free (t); - } - else - var = bind_variable ("REPLY", input_string, 0); - if (var == 0 || readonly_p (var) || noassign_p (var)) - retval = EXECUTION_FAILURE; - else - VUNSETATTR (var, att_invisible); - - free (input_string); - return (retval); - } - - /* This code implements the Posix.2 spec for splitting the words - read and assigning them to variables. */ - orig_input_string = input_string; - - /* Remove IFS white space at the beginning of the input string. If - $IFS is null, no field splitting is performed. */ - for (t = input_string; ifs_chars && *ifs_chars && spctabnl(*t) && isifs(*t); t++) - ; - input_string = t; - for (; list->next; list = list->next) - { - varname = list->word->word; -#if defined (ARRAY_VARS) - if (legal_identifier (varname) == 0 && valid_array_reference (varname, vflags) == 0) -#else - if (legal_identifier (varname) == 0) -#endif - { - sh_invalidid (varname); - free (orig_input_string); - return (EXECUTION_FAILURE); - } - - /* If there are more variables than words read from the input, - the remaining variables are set to the empty string. */ - if (*input_string) - { - /* This call updates INPUT_STRING. */ - t = get_word_from_string (&input_string, ifs_chars, &e); - if (t) - *e = '\0'; - /* Don't bother to remove the CTLESC unless we added one - somewhere while reading the string. */ - if (t && saw_escape) - { - t1 = dequote_string (t); - var = bind_read_variable (varname, t1); - free (t1); - } - else - var = bind_read_variable (varname, t ? t : ""); - } - else - { - t = (char *)0; - var = bind_read_variable (varname, ""); - } - - FREE (t); - if (var == 0) - { - free (orig_input_string); - return (EXECUTION_FAILURE); - } - - stupidly_hack_special_variables (varname); - VUNSETATTR (var, att_invisible); - } - - /* Now assign the rest of the line to the last variable argument. */ -#if defined (ARRAY_VARS) - if (legal_identifier (list->word->word) == 0 && valid_array_reference (list->word->word, vflags) == 0) -#else - if (legal_identifier (list->word->word) == 0) -#endif - { - sh_invalidid (list->word->word); - free (orig_input_string); - return (EXECUTION_FAILURE); - } - -#if 0 - /* This has to be done this way rather than using string_list - and list_string because Posix.2 says that the last variable gets the - remaining words and their intervening separators. */ - input_string = strip_trailing_ifs_whitespace (input_string, ifs_chars, saw_escape); -#else - /* Check whether or not the number of fields is exactly the same as the - number of variables. */ - tofree = NULL; - if (*input_string) - { - t1 = input_string; - t = get_word_from_string (&input_string, ifs_chars, &e); - if (*input_string == 0) - tofree = input_string = t; - else - { - input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape); - tofree = t; - } - } -#endif - - if (saw_escape && input_string && *input_string) - { - t = dequote_string (input_string); - var = bind_read_variable (list->word->word, t); - free (t); - } - else - var = bind_read_variable (list->word->word, input_string ? input_string : ""); - - if (var) - { - stupidly_hack_special_variables (list->word->word); - VUNSETATTR (var, att_invisible); - } - else - retval = EXECUTION_FAILURE; - - FREE (tofree); - free (orig_input_string); - - return (retval); -} - -static SHELL_VAR * -bind_read_variable (name, value) - char *name, *value; -{ - SHELL_VAR *v; - - v = builtin_bind_variable (name, value, 0); - return (v == 0 ? v - : ((readonly_p (v) || noassign_p (v)) ? (SHELL_VAR *)NULL : v)); -} - -#if defined (HANDLE_MULTIBYTE) -static int -read_mbchar (fd, string, ind, ch, unbuffered) - int fd; - char *string; - int ind, ch, unbuffered; -{ - char mbchar[MB_LEN_MAX + 1]; - int i, n, r; - char c; - size_t ret; - mbstate_t ps, ps_back; - wchar_t wc; - - memset (&ps, '\0', sizeof (mbstate_t)); - memset (&ps_back, '\0', sizeof (mbstate_t)); - - mbchar[0] = ch; - i = 1; - for (n = 0; n <= MB_LEN_MAX; n++) - { - ps_back = ps; - ret = mbrtowc (&wc, mbchar, i, &ps); - if (ret == (size_t)-2) - { - ps = ps_back; - - /* We don't want to be interrupted during a multibyte char read */ - if (unbuffered == 2) - r = zreadn (fd, &c, 1); - else if (unbuffered) - r = zread (fd, &c, 1); - else - r = zreadc (fd, &c); - if (r <= 0) - goto mbchar_return; - mbchar[i++] = c; - continue; - } - else if (ret == (size_t)-1 || ret == (size_t)0 || ret > (size_t)0) - break; - } - -mbchar_return: - if (i > 1) /* read a multibyte char */ - /* mbchar[0] is already string[ind-1] */ - for (r = 1; r < i; r++) - string[ind+r-1] = mbchar[r]; - return i - 1; -} -#endif - - -static void -ttyrestore (ttp) - struct ttsave *ttp; -{ - ttsetattr (ttp->fd, &(ttp->attrs)); - tty_modified = 0; + r_read_builtin(list); } void read_tty_cleanup () { - if (tty_modified) - ttyrestore (&termsave); + ; } int read_tty_modified () { - return (tty_modified); -} - -#if defined (READLINE) -static rl_completion_func_t *old_attempted_completion_function = 0; -static rl_hook_func_t *old_startup_hook; -static char *deftext; - -static void -reset_attempted_completion_function (cp) - char *cp; -{ - if (rl_attempted_completion_function == 0 && old_attempted_completion_function) - rl_attempted_completion_function = old_attempted_completion_function; -} - -static int -set_itext () -{ - int r1, r2; - - r1 = r2 = 0; - if (old_startup_hook) - r1 = (*old_startup_hook) (); - if (deftext) - { - r2 = rl_insert_text (deftext); - deftext = (char *)NULL; - rl_startup_hook = old_startup_hook; - old_startup_hook = (rl_hook_func_t *)NULL; - } - return (r1 || r2); + return 0; } -static char * -edit_line (p, itext) - char *p; - char *itext; -{ - char *ret; - int len; - - if (bash_readline_initialized == 0) - initialize_readline (); - - old_attempted_completion_function = rl_attempted_completion_function; - rl_attempted_completion_function = (rl_completion_func_t *)NULL; - bashline_set_event_hook (); - if (itext) - { - old_startup_hook = rl_startup_hook; - rl_startup_hook = set_itext; - deftext = itext; - } - - ret = readline (p); - - rl_attempted_completion_function = old_attempted_completion_function; - old_attempted_completion_function = (rl_completion_func_t *)NULL; - bashline_reset_event_hook (); - - if (ret == 0) - return ret; - len = strlen (ret); - ret = (char *)xrealloc (ret, len + 2); - ret[len++] = delim; - ret[len] = '\0'; - return ret; -} - -static int old_delim_ctype; -static rl_command_func_t *old_delim_func; -static int old_newline_ctype; -static rl_command_func_t *old_newline_func; - -static unsigned char delim_char; - -static void -set_eol_delim (c) - int c; -{ - Keymap cmap; - - if (bash_readline_initialized == 0) - initialize_readline (); - cmap = rl_get_keymap (); - - /* Save the old delimiter char binding */ - old_newline_ctype = cmap[RETURN].type; - old_newline_func = cmap[RETURN].function; - old_delim_ctype = cmap[c].type; - old_delim_func = cmap[c].function; - - /* Change newline to self-insert */ - cmap[RETURN].type = ISFUNC; - cmap[RETURN].function = rl_insert; - - /* Bind the delimiter character to accept-line. */ - cmap[c].type = ISFUNC; - cmap[c].function = rl_newline; - - delim_char = c; -} - -static void -reset_eol_delim (cp) - char *cp; -{ - Keymap cmap; - - cmap = rl_get_keymap (); - - cmap[RETURN].type = old_newline_ctype; - cmap[RETURN].function = old_newline_func; - - cmap[delim_char].type = old_delim_ctype; - cmap[delim_char].function = old_delim_func; -} -#endif diff --git a/bash-5.1/builtins_rust/jobs/Cargo.toml b/bash-5.1/builtins_rust/jobs/Cargo.toml index d07d3572..fa26bda5 100644 --- a/bash-5.1/builtins_rust/jobs/Cargo.toml +++ b/bash-5.1/builtins_rust/jobs/Cargo.toml @@ -2,7 +2,7 @@ authors = ["huzhengming"] name = "rjobs" version = "0.0.1" -build = "build.rs" +build = "../build.rs" edition = "2021" diff --git a/record.txt b/record.txt index 03a89765..bcacb065 100644 --- a/record.txt +++ b/record.txt @@ -19,3 +19,4 @@ 13 14 15 +16 -- Gitee From faa5babfbe3a81e7f30c721263330cbd7d1e9988 Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Wed, 14 Jun 2023 11:05:15 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E6=8C=87=E9=92=88?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash-5.1/.gitignore | 1 - bash-5.1/Cargo.toml | 1 - bash-5.1/builtins/read.def | 1074 +++++++++++++++++++++++- bash-5.1/builtins_rust/jobs/Cargo.toml | 2 +- bash-5.1/builtins_rust/jobs/src/lib.rs | 77 +- record.txt | 1 + 6 files changed, 1107 insertions(+), 49 deletions(-) diff --git a/bash-5.1/.gitignore b/bash-5.1/.gitignore index 4c50e886..6c7dbc5f 100644 --- a/bash-5.1/.gitignore +++ b/bash-5.1/.gitignore @@ -1,5 +1,4 @@ *.swp tags -Cargo.lock target/ .vscode diff --git a/bash-5.1/Cargo.toml b/bash-5.1/Cargo.toml index 3c97c62e..ec2f4f94 100644 --- a/bash-5.1/Cargo.toml +++ b/bash-5.1/Cargo.toml @@ -10,4 +10,3 @@ members = ["builtins/command1", "builtins/command2"] [dependencies] command1 = {path = "./builtins/command1"} command2 = {path = "./builtins/command2"} -read = {path = "./builtins_rust/read"} diff --git a/bash-5.1/builtins/read.def b/bash-5.1/builtins/read.def index 6e1f5375..39e16e84 100644 --- a/bash-5.1/builtins/read.def +++ b/bash-5.1/builtins/read.def @@ -1,3 +1,23 @@ +This file is read.def, from which is created read.c. +It implements the builtin "read" in Bash. + +Copyright (C) 1987-2020 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Bash is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bash. If not, see . + $PRODUCES read.c $BUILTIN read @@ -92,11 +112,59 @@ $END extern int errno; #endif -extern int r_read_builtin (WORD_LIST *); +struct ttsave +{ + int fd; + TTYSTRUCT attrs; +}; + +#if defined (READLINE) +static void reset_attempted_completion_function PARAMS((char *)); +static int set_itext PARAMS((void)); +static char *edit_line PARAMS((char *, char *)); +static void set_eol_delim PARAMS((int)); +static void reset_eol_delim PARAMS((char *)); +#endif +static SHELL_VAR *bind_read_variable PARAMS((char *, char *)); +#if defined (HANDLE_MULTIBYTE) +static int read_mbchar PARAMS((int, char *, int, int, int)); +#endif +static void ttyrestore PARAMS((struct ttsave *)); + +static sighandler sigalrm PARAMS((int)); +static void reset_alarm PARAMS((void)); +/* Try this to see what the rest of the shell can do with the information. */ procenv_t alrmbuf; int sigalrm_seen; +static int reading, tty_modified; +static SigHandler *old_alrm; +static unsigned char delim; + +static struct ttsave termsave; + +/* In all cases, SIGALRM just sets a flag that we check periodically. This + avoids problems with the semi-tricky stuff we do with the xfree of + input_string at the top of the unwind-protect list (see below). */ + +/* Set a flag that CHECK_ALRM can check. This relies on zread or read_builtin + calling trap.c:check_signals(), which knows about sigalrm_seen and alrmbuf. */ +static sighandler +sigalrm (s) + int s; +{ + sigalrm_seen = 1; +} + +static void +reset_alarm () +{ + /* Cancel alarm before restoring signal handler. */ + falarm (0, 0); + set_signal_handler (SIGALRM, old_alrm); +} + /* Read the value of the shell variables whose names follow. The reading is done from the current input stream, whatever that may be. Successive words of the input line are assigned @@ -107,18 +175,1016 @@ int read_builtin (list) WORD_LIST *list; { - r_read_builtin(list); + register char *varname; + int size, nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2, nflag; + volatile int i; + int input_is_tty, input_is_pipe, unbuffered_read, skip_ctlesc, skip_ctlnul; + int raw, edit, nchars, silent, have_timeout, ignore_delim, fd; + int lastsig, t_errno; + int mb_cur_max; + unsigned int tmsec, tmusec; + long ival, uval; + intmax_t intval; + char c; + char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname; + char *e, *t, *t1, *ps2, *tofree; + struct stat tsb; + SHELL_VAR *var; + TTYSTRUCT ttattrs, ttset; +#if defined (ARRAY_VARS) + WORD_LIST *alist; + int vflags; +#endif +#if defined (READLINE) + char *rlbuf, *itext; + int rlind; + FILE *save_instream; +#endif + + USE_VAR(size); + USE_VAR(i); + USE_VAR(pass_next); + USE_VAR(print_ps2); + USE_VAR(saw_escape); + USE_VAR(input_is_pipe); +/* USE_VAR(raw); */ + USE_VAR(edit); + USE_VAR(tmsec); + USE_VAR(tmusec); + USE_VAR(nchars); + USE_VAR(silent); + USE_VAR(ifs_chars); + USE_VAR(prompt); + USE_VAR(arrayname); +#if defined (READLINE) + USE_VAR(rlbuf); + USE_VAR(rlind); + USE_VAR(itext); +#endif + USE_VAR(list); + USE_VAR(ps2); + USE_VAR(lastsig); + + sigalrm_seen = reading = tty_modified = 0; + + i = 0; /* Index into the string that we are reading. */ + raw = edit = 0; /* Not reading raw input by default. */ + silent = 0; + arrayname = prompt = (char *)NULL; + fd = 0; /* file descriptor to read from */ + +#if defined (READLINE) + rlbuf = itext = (char *)0; + rlind = 0; +#endif + + mb_cur_max = MB_CUR_MAX; + tmsec = tmusec = 0; /* no timeout */ + nr = nchars = input_is_tty = input_is_pipe = unbuffered_read = have_timeout = 0; + delim = '\n'; /* read until newline */ + ignore_delim = nflag = 0; + + reset_internal_getopt (); + while ((opt = internal_getopt (list, "ersa:d:i:n:p:t:u:N:")) != -1) + { + switch (opt) + { + case 'r': + raw = 1; + break; + case 'p': + prompt = list_optarg; + break; + case 's': + silent = 1; + break; + case 'e': +#if defined (READLINE) + edit = 1; +#endif + break; + case 'i': +#if defined (READLINE) + itext = list_optarg; +#endif + break; +#if defined (ARRAY_VARS) + case 'a': + arrayname = list_optarg; + break; +#endif + case 't': + code = uconvert (list_optarg, &ival, &uval, (char **)NULL); + if (code == 0 || ival < 0 || uval < 0) + { + builtin_error (_("%s: invalid timeout specification"), list_optarg); + return (EXECUTION_FAILURE); + } + else + { + have_timeout = 1; + tmsec = ival; + tmusec = uval; + } + break; + case 'N': + ignore_delim = 1; + delim = -1; + case 'n': + nflag = 1; + code = legal_number (list_optarg, &intval); + if (code == 0 || intval < 0 || intval != (int)intval) + { + sh_invalidnum (list_optarg); + return (EXECUTION_FAILURE); + } + else + nchars = intval; + break; + case 'u': + code = legal_number (list_optarg, &intval); + if (code == 0 || intval < 0 || intval != (int)intval) + { + builtin_error (_("%s: invalid file descriptor specification"), list_optarg); + return (EXECUTION_FAILURE); + } + else + fd = intval; + if (sh_validfd (fd) == 0) + { + builtin_error (_("%d: invalid file descriptor: %s"), fd, strerror (errno)); + return (EXECUTION_FAILURE); + } + break; + case 'd': + delim = *list_optarg; + break; + CASE_HELPOPT; + default: + builtin_usage (); + return (EX_USAGE); + } + } + list = loptend; + + /* `read -t 0 var' tests whether input is available with select/FIONREAD, + and fails if those are unavailable */ + if (have_timeout && tmsec == 0 && tmusec == 0) +#if 0 + return (EXECUTION_FAILURE); +#else + return (input_avail (fd) ? EXECUTION_SUCCESS : EXECUTION_FAILURE); +#endif + + /* Convenience: check early whether or not the first of possibly several + variable names is a valid identifier, and bail early if so. */ +#if defined (ARRAY_VARS) + vflags = assoc_expand_once ? (VA_NOEXPAND|VA_ONEWORD) : 0; + if (list && legal_identifier (list->word->word) == 0 && valid_array_reference (list->word->word, vflags) == 0) +#else + if (list && legal_identifier (list->word->word) == 0) +#endif + { + sh_invalidid (list->word->word); + return (EXECUTION_FAILURE); + } + + /* If we're asked to ignore the delimiter, make sure we do. */ + if (ignore_delim) + delim = -1; + + /* IF IFS is unset, we use the default of " \t\n". */ + ifs_chars = getifs (); + if (ifs_chars == 0) /* XXX - shouldn't happen */ + ifs_chars = ""; + /* If we want to read exactly NCHARS chars, don't split on IFS */ + if (ignore_delim) + ifs_chars = ""; + for (skip_ctlesc = skip_ctlnul = 0, e = ifs_chars; *e; e++) + skip_ctlesc |= *e == CTLESC, skip_ctlnul |= *e == CTLNUL; + + input_string = (char *)xmalloc (size = 112); /* XXX was 128 */ + input_string[0] = '\0'; + + /* More input and options validation */ + if (nflag == 1 && nchars == 0) + { + retval = read (fd, &c, 0); + retval = (retval >= 0) ? EXECUTION_SUCCESS : EXECUTION_FAILURE; + goto assign_vars; /* bail early if asked to read 0 chars */ + } + + /* $TMOUT, if set, is the default timeout for read. */ + if (have_timeout == 0 && (e = get_string_value ("TMOUT"))) + { + code = uconvert (e, &ival, &uval, (char **)NULL); + if (code == 0 || ival < 0 || uval < 0) + tmsec = tmusec = 0; + else + { + tmsec = ival; + tmusec = uval; + } + } + + begin_unwind_frame ("read_builtin"); + +#if defined (BUFFERED_INPUT) + if (interactive == 0 && default_buffered_input >= 0 && fd_is_bash_input (fd)) + sync_buffered_stream (default_buffered_input); +#endif + +#if 1 + input_is_tty = isatty (fd); +#else + input_is_tty = 1; +#endif + if (input_is_tty == 0) +#ifndef __CYGWIN__ + input_is_pipe = (lseek (fd, 0L, SEEK_CUR) < 0) && (errno == ESPIPE); +#else + input_is_pipe = 1; +#endif + + /* If the -p, -e or -s flags were given, but input is not coming from the + terminal, turn them off. */ + if ((prompt || edit || silent) && input_is_tty == 0) + { + prompt = (char *)NULL; +#if defined (READLINE) + itext = (char *)NULL; +#endif + edit = silent = 0; + } + +#if defined (READLINE) + if (edit) + add_unwind_protect (xfree, rlbuf); +#endif + + pass_next = 0; /* Non-zero signifies last char was backslash. */ + saw_escape = 0; /* Non-zero signifies that we saw an escape char */ + + if (tmsec > 0 || tmusec > 0) + { + /* Turn off the timeout if stdin is a regular file (e.g. from + input redirection). */ + if ((fstat (fd, &tsb) < 0) || S_ISREG (tsb.st_mode)) + tmsec = tmusec = 0; + } + + if (tmsec > 0 || tmusec > 0) + { + code = setjmp_nosigs (alrmbuf); + if (code) + { + sigalrm_seen = 0; + /* Tricky. The top of the unwind-protect stack is the free of + input_string. We want to run all the rest and use input_string, + so we have to save input_string temporarily, run the unwind- + protects, then restore input_string so we can use it later */ + orig_input_string = 0; + input_string[i] = '\0'; /* make sure it's terminated */ + if (i == 0) + { + t = (char *)xmalloc (1); + t[0] = 0; + } + else + t = savestring (input_string); + + run_unwind_frame ("read_builtin"); + input_string = t; + retval = 128+SIGALRM; + goto assign_vars; + } + if (interactive_shell == 0) + initialize_terminating_signals (); + old_alrm = set_signal_handler (SIGALRM, sigalrm); + add_unwind_protect (reset_alarm, (char *)NULL); +#if defined (READLINE) + if (edit) + { + add_unwind_protect (reset_attempted_completion_function, (char *)NULL); + add_unwind_protect (bashline_reset_event_hook, (char *)NULL); + } +#endif + falarm (tmsec, tmusec); + } + + /* If we've been asked to read only NCHARS chars, or we're using some + character other than newline to terminate the line, do the right + thing to readline or the tty. */ + if (nchars > 0 || delim != '\n') + { +#if defined (READLINE) + if (edit) + { + if (nchars > 0) + { + unwind_protect_int (rl_num_chars_to_read); + rl_num_chars_to_read = nchars; + } + if (delim != '\n') + { + set_eol_delim (delim); + add_unwind_protect (reset_eol_delim, (char *)NULL); + } + } + else +#endif + if (input_is_tty) + { + /* ttsave() */ + termsave.fd = fd; + ttgetattr (fd, &ttattrs); + termsave.attrs = ttattrs; + + ttset = ttattrs; + i = silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset); + if (i < 0) + sh_ttyerror (1); + tty_modified = 1; + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); + if (interactive_shell == 0) + initialize_terminating_signals (); + } + } + else if (silent) /* turn off echo but leave term in canonical mode */ + { + /* ttsave (); */ + termsave.fd = fd; + ttgetattr (fd, &ttattrs); + termsave.attrs = ttattrs; + + ttset = ttattrs; + i = ttfd_noecho (fd, &ttset); /* ttnoecho (); */ + if (i < 0) + sh_ttyerror (1); + + tty_modified = 1; + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); + if (interactive_shell == 0) + initialize_terminating_signals (); + } + +#if defined (READLINE) + save_instream = 0; + if (edit && fd != 0) + { + if (bash_readline_initialized == 0) + initialize_readline (); + + unwind_protect_var (rl_instream); + save_instream = rl_instream; + rl_instream = fdopen (fd, "r"); + } +#endif + + /* This *must* be the top unwind-protect on the stack, so the manipulation + of the unwind-protect stack after the realloc() works right. */ + add_unwind_protect (xfree, input_string); + + CHECK_ALRM; + if ((nchars > 0) && (input_is_tty == 0) && ignore_delim) /* read -N */ + unbuffered_read = 2; + else if ((nchars > 0) || (delim != '\n') || input_is_pipe) + unbuffered_read = 1; + + if (prompt && edit == 0) + { + fprintf (stderr, "%s", prompt); + fflush (stderr); + } + +#if defined (__CYGWIN__) && defined (O_TEXT) + setmode (0, O_TEXT); +#endif + + ps2 = 0; + for (print_ps2 = eof = retval = 0;;) + { + CHECK_ALRM; + +#if defined (READLINE) + if (edit) + { + /* If we have a null delimiter, don't treat NULL as ending the line */ + if (rlbuf && rlbuf[rlind] == '\0' && delim != '\0') + { + free (rlbuf); + rlbuf = (char *)0; + } + if (rlbuf == 0) + { + reading = 1; + rlbuf = edit_line (prompt ? prompt : "", itext); + reading = 0; + rlind = 0; + } + if (rlbuf == 0) + { + eof = 1; + break; + } + c = rlbuf[rlind++]; + } + else + { +#endif + + if (print_ps2) + { + if (ps2 == 0) + ps2 = get_string_value ("PS2"); + fprintf (stderr, "%s", ps2 ? ps2 : ""); + fflush (stderr); + print_ps2 = 0; + } + + reading = 1; + CHECK_ALRM; + errno = 0; + if (unbuffered_read == 2) + retval = posixly_correct ? zreadintr (fd, &c, 1) : zreadn (fd, &c, nchars - nr); + else if (unbuffered_read) + retval = posixly_correct ? zreadintr (fd, &c, 1) : zread (fd, &c, 1); + else + retval = posixly_correct ? zreadcintr (fd, &c) : zreadc (fd, &c); + reading = 0; + + if (retval <= 0) + { + int t; + + t = errno; + if (retval < 0 && errno == EINTR) + { + check_signals (); /* in case we didn't call zread via zreadc */ + lastsig = LASTSIG(); + if (lastsig == 0) + lastsig = trapped_signal_received; +#if 0 + run_pending_traps (); /* because interrupt_immediately is not set */ +#endif + } + else + lastsig = 0; + if (terminating_signal && tty_modified) + ttyrestore (&termsave); /* fix terminal before exiting */ + CHECK_TERMSIG; + eof = 1; + errno = t; /* preserve it for the error message below */ + break; + } + + QUIT; /* in case we didn't call check_signals() */ +#if defined (READLINE) + } +#endif + + if (retval <= 0) /* XXX shouldn't happen */ + CHECK_ALRM; + + /* XXX -- use i + mb_cur_max (at least 4) for multibyte/read_mbchar */ + if (i + (mb_cur_max > 4 ? mb_cur_max : 4) >= size) + { + char *t; + t = (char *)xrealloc (input_string, size += 128); + + /* Only need to change unwind-protect if input_string changes */ + if (t != input_string) + { + input_string = t; + remove_unwind_protect (); + add_unwind_protect (xfree, input_string); + } + } + + /* If the next character is to be accepted verbatim, a backslash + newline pair still disappears from the input. */ + if (pass_next) + { + pass_next = 0; + if (c == '\n') + { + if (skip_ctlesc == 0 && i > 0) + i--; /* back up over the CTLESC */ + if (interactive && input_is_tty && raw == 0) + print_ps2 = 1; + } + else + goto add_char; + continue; + } + + /* This may cause problems if IFS contains CTLESC */ + if (c == '\\' && raw == 0) + { + pass_next++; + if (skip_ctlesc == 0) + { + saw_escape++; + input_string[i++] = CTLESC; + } + continue; + } + + if (ignore_delim == 0 && (unsigned char)c == delim) + break; + + if (c == '\0' && delim != '\0') + continue; /* skip NUL bytes in input */ + + if ((skip_ctlesc == 0 && c == CTLESC) || (skip_ctlnul == 0 && c == CTLNUL)) + { + saw_escape++; + input_string[i++] = CTLESC; + } + +add_char: + input_string[i++] = c; + CHECK_ALRM; + +#if defined (HANDLE_MULTIBYTE) + /* XXX - what if C == 127? Can DEL introduce a multibyte sequence? */ + if (mb_cur_max > 1 && is_basic (c) == 0) + { + input_string[i] = '\0'; /* for simplicity and debugging */ + /* If we got input from readline, grab the next multibyte char from + rlbuf. */ +# if defined (READLINE) + if (edit) + { + size_t clen; + clen = mbrlen (rlbuf + rlind - 1, mb_cur_max, (mbstate_t *)NULL); + /* We only deal with valid multibyte sequences longer than one + byte. If we get anything else, we leave the one character + copied and move on to the next. */ + if ((int)clen > 1) + { + memcpy (input_string+i, rlbuf+rlind, clen-1); + i += clen - 1; + rlind += clen - 1; + } + } + else +# endif + if (locale_utf8locale == 0 || ((c & 0x80) != 0)) + i += read_mbchar (fd, input_string, i, c, unbuffered_read); + } +#endif + + nr++; + + if (nchars > 0 && nr >= nchars) + break; + } + input_string[i] = '\0'; + CHECK_ALRM; + +#if defined (READLINE) + if (edit) + free (rlbuf); +#endif + + if (retval < 0) + { + t_errno = errno; + if (errno != EINTR) + builtin_error (_("read error: %d: %s"), fd, strerror (errno)); + run_unwind_frame ("read_builtin"); + return ((t_errno != EINTR) ? EXECUTION_FAILURE : 128+lastsig); + } + + if (tmsec > 0 || tmusec > 0) + reset_alarm (); + + if (nchars > 0 || delim != '\n') + { +#if defined (READLINE) + if (edit) + { + if (nchars > 0) + rl_num_chars_to_read = 0; + if (delim != '\n') + reset_eol_delim ((char *)NULL); + } + else +#endif + if (input_is_tty) + ttyrestore (&termsave); + } + else if (silent) + ttyrestore (&termsave); + + if (unbuffered_read == 0) + zsyncfd (fd); + +#if defined (READLINE) + if (save_instream) + rl_instream = save_instream; /* can't portably free it */ +#endif + + discard_unwind_frame ("read_builtin"); + + retval = eof ? EXECUTION_FAILURE : EXECUTION_SUCCESS; + +assign_vars: + +#if defined (ARRAY_VARS) + /* If -a was given, take the string read, break it into a list of words, + an assign them to `arrayname' in turn. */ + if (arrayname) + { + if (legal_identifier (arrayname) == 0) + { + sh_invalidid (arrayname); + free (input_string); + return (EXECUTION_FAILURE); + } + + var = find_or_make_array_variable (arrayname, 1); + if (var == 0) + { + free (input_string); + return EXECUTION_FAILURE; /* readonly or noassign */ + } + if (assoc_p (var)) + { + builtin_error (_("%s: cannot convert associative to indexed array"), arrayname); + free (input_string); + return EXECUTION_FAILURE; /* existing associative array */ + } + else if (invisible_p (var)) + VUNSETATTR (var, att_invisible); + array_flush (array_cell (var)); + + alist = list_string (input_string, ifs_chars, 0); + if (alist) + { + if (saw_escape) + dequote_list (alist); + else + word_list_remove_quoted_nulls (alist); + assign_array_var_from_word_list (var, alist, 0); + dispose_words (alist); + } + free (input_string); + return (retval); + } +#endif /* ARRAY_VARS */ + + /* If there are no variables, save the text of the line read to the + variable $REPLY. ksh93 strips leading and trailing IFS whitespace, + so that `read x ; echo "$x"' and `read ; echo "$REPLY"' behave the + same way, but I believe that the difference in behaviors is useful + enough to not do it. Without the bash behavior, there is no way + to read a line completely without interpretation or modification + unless you mess with $IFS (e.g., setting it to the empty string). + If you disagree, change the occurrences of `#if 0' to `#if 1' below. */ + if (list == 0) + { +#if 0 + orig_input_string = input_string; + for (t = input_string; ifs_chars && *ifs_chars && spctabnl(*t) && isifs(*t); t++) + ; + input_string = t; + input_string = strip_trailing_ifs_whitespace (input_string, ifs_chars, saw_escape); +#endif + + if (saw_escape) + { + t = dequote_string (input_string); + var = bind_variable ("REPLY", t, 0); + free (t); + } + else + var = bind_variable ("REPLY", input_string, 0); + if (var == 0 || readonly_p (var) || noassign_p (var)) + retval = EXECUTION_FAILURE; + else + VUNSETATTR (var, att_invisible); + + free (input_string); + return (retval); + } + + /* This code implements the Posix.2 spec for splitting the words + read and assigning them to variables. */ + orig_input_string = input_string; + + /* Remove IFS white space at the beginning of the input string. If + $IFS is null, no field splitting is performed. */ + for (t = input_string; ifs_chars && *ifs_chars && spctabnl(*t) && isifs(*t); t++) + ; + input_string = t; + for (; list->next; list = list->next) + { + varname = list->word->word; +#if defined (ARRAY_VARS) + if (legal_identifier (varname) == 0 && valid_array_reference (varname, vflags) == 0) +#else + if (legal_identifier (varname) == 0) +#endif + { + sh_invalidid (varname); + free (orig_input_string); + return (EXECUTION_FAILURE); + } + + /* If there are more variables than words read from the input, + the remaining variables are set to the empty string. */ + if (*input_string) + { + /* This call updates INPUT_STRING. */ + t = get_word_from_string (&input_string, ifs_chars, &e); + if (t) + *e = '\0'; + /* Don't bother to remove the CTLESC unless we added one + somewhere while reading the string. */ + if (t && saw_escape) + { + t1 = dequote_string (t); + var = bind_read_variable (varname, t1); + free (t1); + } + else + var = bind_read_variable (varname, t ? t : ""); + } + else + { + t = (char *)0; + var = bind_read_variable (varname, ""); + } + + FREE (t); + if (var == 0) + { + free (orig_input_string); + return (EXECUTION_FAILURE); + } + + stupidly_hack_special_variables (varname); + VUNSETATTR (var, att_invisible); + } + + /* Now assign the rest of the line to the last variable argument. */ +#if defined (ARRAY_VARS) + if (legal_identifier (list->word->word) == 0 && valid_array_reference (list->word->word, vflags) == 0) +#else + if (legal_identifier (list->word->word) == 0) +#endif + { + sh_invalidid (list->word->word); + free (orig_input_string); + return (EXECUTION_FAILURE); + } + +#if 0 + /* This has to be done this way rather than using string_list + and list_string because Posix.2 says that the last variable gets the + remaining words and their intervening separators. */ + input_string = strip_trailing_ifs_whitespace (input_string, ifs_chars, saw_escape); +#else + /* Check whether or not the number of fields is exactly the same as the + number of variables. */ + tofree = NULL; + if (*input_string) + { + t1 = input_string; + t = get_word_from_string (&input_string, ifs_chars, &e); + if (*input_string == 0) + tofree = input_string = t; + else + { + input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape); + tofree = t; + } + } +#endif + + if (saw_escape && input_string && *input_string) + { + t = dequote_string (input_string); + var = bind_read_variable (list->word->word, t); + free (t); + } + else + var = bind_read_variable (list->word->word, input_string ? input_string : ""); + + if (var) + { + stupidly_hack_special_variables (list->word->word); + VUNSETATTR (var, att_invisible); + } + else + retval = EXECUTION_FAILURE; + + FREE (tofree); + free (orig_input_string); + + return (retval); +} + +static SHELL_VAR * +bind_read_variable (name, value) + char *name, *value; +{ + SHELL_VAR *v; + + v = builtin_bind_variable (name, value, 0); + return (v == 0 ? v + : ((readonly_p (v) || noassign_p (v)) ? (SHELL_VAR *)NULL : v)); +} + +#if defined (HANDLE_MULTIBYTE) +static int +read_mbchar (fd, string, ind, ch, unbuffered) + int fd; + char *string; + int ind, ch, unbuffered; +{ + char mbchar[MB_LEN_MAX + 1]; + int i, n, r; + char c; + size_t ret; + mbstate_t ps, ps_back; + wchar_t wc; + + memset (&ps, '\0', sizeof (mbstate_t)); + memset (&ps_back, '\0', sizeof (mbstate_t)); + + mbchar[0] = ch; + i = 1; + for (n = 0; n <= MB_LEN_MAX; n++) + { + ps_back = ps; + ret = mbrtowc (&wc, mbchar, i, &ps); + if (ret == (size_t)-2) + { + ps = ps_back; + + /* We don't want to be interrupted during a multibyte char read */ + if (unbuffered == 2) + r = zreadn (fd, &c, 1); + else if (unbuffered) + r = zread (fd, &c, 1); + else + r = zreadc (fd, &c); + if (r <= 0) + goto mbchar_return; + mbchar[i++] = c; + continue; + } + else if (ret == (size_t)-1 || ret == (size_t)0 || ret > (size_t)0) + break; + } + +mbchar_return: + if (i > 1) /* read a multibyte char */ + /* mbchar[0] is already string[ind-1] */ + for (r = 1; r < i; r++) + string[ind+r-1] = mbchar[r]; + return i - 1; +} +#endif + + +static void +ttyrestore (ttp) + struct ttsave *ttp; +{ + ttsetattr (ttp->fd, &(ttp->attrs)); + tty_modified = 0; } void read_tty_cleanup () { - ; + if (tty_modified) + ttyrestore (&termsave); } int read_tty_modified () { - return 0; + return (tty_modified); +} + +#if defined (READLINE) +static rl_completion_func_t *old_attempted_completion_function = 0; +static rl_hook_func_t *old_startup_hook; +static char *deftext; + +static void +reset_attempted_completion_function (cp) + char *cp; +{ + if (rl_attempted_completion_function == 0 && old_attempted_completion_function) + rl_attempted_completion_function = old_attempted_completion_function; +} + +static int +set_itext () +{ + int r1, r2; + + r1 = r2 = 0; + if (old_startup_hook) + r1 = (*old_startup_hook) (); + if (deftext) + { + r2 = rl_insert_text (deftext); + deftext = (char *)NULL; + rl_startup_hook = old_startup_hook; + old_startup_hook = (rl_hook_func_t *)NULL; + } + return (r1 || r2); } +static char * +edit_line (p, itext) + char *p; + char *itext; +{ + char *ret; + int len; + + if (bash_readline_initialized == 0) + initialize_readline (); + + old_attempted_completion_function = rl_attempted_completion_function; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; + bashline_set_event_hook (); + if (itext) + { + old_startup_hook = rl_startup_hook; + rl_startup_hook = set_itext; + deftext = itext; + } + + ret = readline (p); + + rl_attempted_completion_function = old_attempted_completion_function; + old_attempted_completion_function = (rl_completion_func_t *)NULL; + bashline_reset_event_hook (); + + if (ret == 0) + return ret; + len = strlen (ret); + ret = (char *)xrealloc (ret, len + 2); + ret[len++] = delim; + ret[len] = '\0'; + return ret; +} + +static int old_delim_ctype; +static rl_command_func_t *old_delim_func; +static int old_newline_ctype; +static rl_command_func_t *old_newline_func; + +static unsigned char delim_char; + +static void +set_eol_delim (c) + int c; +{ + Keymap cmap; + + if (bash_readline_initialized == 0) + initialize_readline (); + cmap = rl_get_keymap (); + + /* Save the old delimiter char binding */ + old_newline_ctype = cmap[RETURN].type; + old_newline_func = cmap[RETURN].function; + old_delim_ctype = cmap[c].type; + old_delim_func = cmap[c].function; + + /* Change newline to self-insert */ + cmap[RETURN].type = ISFUNC; + cmap[RETURN].function = rl_insert; + + /* Bind the delimiter character to accept-line. */ + cmap[c].type = ISFUNC; + cmap[c].function = rl_newline; + + delim_char = c; +} + +static void +reset_eol_delim (cp) + char *cp; +{ + Keymap cmap; + + cmap = rl_get_keymap (); + + cmap[RETURN].type = old_newline_ctype; + cmap[RETURN].function = old_newline_func; + + cmap[delim_char].type = old_delim_ctype; + cmap[delim_char].function = old_delim_func; +} +#endif diff --git a/bash-5.1/builtins_rust/jobs/Cargo.toml b/bash-5.1/builtins_rust/jobs/Cargo.toml index fa26bda5..d07d3572 100644 --- a/bash-5.1/builtins_rust/jobs/Cargo.toml +++ b/bash-5.1/builtins_rust/jobs/Cargo.toml @@ -2,7 +2,7 @@ authors = ["huzhengming"] name = "rjobs" version = "0.0.1" -build = "../build.rs" +build = "build.rs" edition = "2021" diff --git a/bash-5.1/builtins_rust/jobs/src/lib.rs b/bash-5.1/builtins_rust/jobs/src/lib.rs index 9b8a9a7a..5c016271 100644 --- a/bash-5.1/builtins_rust/jobs/src/lib.rs +++ b/bash-5.1/builtins_rust/jobs/src/lib.rs @@ -1,7 +1,7 @@ extern crate libc; extern crate nix; -use libc::{F_UNLCK, c_char, c_long}; +use libc::{c_char, c_long}; use std::ffi::CString; #[repr(C)] @@ -392,12 +392,11 @@ extern "C" { pub extern "C" fn r_execute_list_with_replacements (list:*mut WORD_LIST)->i32{ println!("r_execute_list_with_replacements"); unsafe{ - let mut l:WORD_LIST=WORD_LIST{next:list,word:(*list).word}; + let mut l:WORD_LIST=*list; let mut job:i32; let result:i32; let command:*mut COMMAND; - - + /* First do the replacement of job specifications with pids. */ while l.next as u8 !=0 { @@ -500,20 +499,21 @@ pub extern "C" fn r_jobs_builtin(list:*mut WORD_LIST)->i32{ } return EXECUTION_SUCCESS!(); } - - while loptend as u8 !=0 { + + let mut loptendt=*loptend; + while loptendt.next as u8 !=0 { BLOCK_CHILD !(Some(&mut set), Some(&mut oset)); - job = get_job_spec (loptend); + job = get_job_spec (&mut loptendt); if (job == NO_JOB!()) || jobs as u8 == 0 || get_job_by_jid !(job) as u8 == 0 { - sh_badjob ((*(*loptend).word).word); + sh_badjob ((*loptendt.word).word); any_failed+=1; } else if (job != DUP_JOB!()){ list_one_job (0 as * mut JOB, form, 0, job); } UNBLOCK_CHILD !(Some(&oset)); - loptend = (*loptend).next; + loptendt = *loptendt.next; } if any_failed !=0 { return EXECUTION_FAILURE!(); @@ -567,7 +567,7 @@ pub extern "C" fn r_disown_builtin (list:* mut WORD_LIST)->libc::c_int{ return EXECUTION_SUCCESS!(); } - + BLOCK_CHILD !(Some(&mut set), Some(&mut oset)); if (loptend as u8 !=0 && legal_number ((*(*loptend).word).word, &mut pid_value) !=0 && pid_value == pid_value) { job=get_job_by_pid ( pid_value as i32, 0, 0 as *mut*mut PROCESS); @@ -589,40 +589,33 @@ pub extern "C" fn r_disown_builtin (list:* mut WORD_LIST)->libc::c_int{ } UNBLOCK_CHILD !(Some(&oset)); - - if loptend as u8 !=0{ - loptend = (*loptend).next; - } - - - while loptend as u8 !=0 { - BLOCK_CHILD !(Some(&mut set), Some(&mut oset)); - if (loptend as u8 !=0 && legal_number ((*(*loptend).word).word, &mut pid_value) !=0 && pid_value == pid_value) { - job=get_job_by_pid ( pid_value as i32, 0, 0 as *mut*mut PROCESS); - }else { - get_job_spec (loptend); - + + + if loptend as u8 !=0 { + let mut loptendt=*loptend; + while loptendt.next as u8 !=0 { + loptendt = *loptendt.next; + BLOCK_CHILD !(Some(&mut set), Some(&mut oset)); + if legal_number ((*loptendt.word).word, &mut pid_value) !=0 && pid_value == pid_value { + job=get_job_by_pid ( pid_value as i32, 0, 0 as *mut*mut PROCESS); + }else { + get_job_spec (&mut loptendt); + + } + if job == NO_JOB!() || jobs as u8 !=0 || INVALID_JOB!(job){ + + sh_badjob ((*loptendt.word).word); + + retval = EXECUTION_FAILURE!(); + } else if nohup_only !=0{ + nohup_job (job); + } else { + delete_job (job, 1); + } + + UNBLOCK_CHILD !(Some(&oset)); } - if job == NO_JOB!() || jobs as u8 !=0 || INVALID_JOB!(job){ - if loptend as u8 !=0 { - sh_badjob ((*(*loptend).word).word); - }else { - sh_badjob (CString::new("current").unwrap().as_ptr() as * mut c_char); - } - retval = EXECUTION_FAILURE!(); - } else if nohup_only !=0{ - nohup_job (job); - } else { - delete_job (job, 1); - } - - UNBLOCK_CHILD !(Some(&oset)); - - if loptend as u8 !=0{ - loptend = (*loptend).next; - } } - return retval; } } \ No newline at end of file diff --git a/record.txt b/record.txt index bcacb065..cc66e279 100644 --- a/record.txt +++ b/record.txt @@ -20,3 +20,4 @@ 14 15 16 +17 -- Gitee From 582ea093e35d9f47adae103975b35f7a6ee280e9 Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Wed, 14 Jun 2023 11:05:25 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=20Merge=20=E4=BC=98=E5=8C=96=E6=8C=87?= =?UTF-8?q?=E9=92=88=E4=BC=A0=E5=8F=82=E9=97=AE=E9=A2=98=20into=20rustdev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash-5.1/.gitignore | 1 + bash-5.1/Cargo.toml | 1 + bash-5.1/builtins/read.def | 1074 +----------------------- bash-5.1/builtins_rust/jobs/Cargo.toml | 2 +- record.txt | 1 + 5 files changed, 8 insertions(+), 1071 deletions(-) diff --git a/bash-5.1/.gitignore b/bash-5.1/.gitignore index 6c7dbc5f..4c50e886 100644 --- a/bash-5.1/.gitignore +++ b/bash-5.1/.gitignore @@ -1,4 +1,5 @@ *.swp tags +Cargo.lock target/ .vscode diff --git a/bash-5.1/Cargo.toml b/bash-5.1/Cargo.toml index ec2f4f94..3c97c62e 100644 --- a/bash-5.1/Cargo.toml +++ b/bash-5.1/Cargo.toml @@ -10,3 +10,4 @@ members = ["builtins/command1", "builtins/command2"] [dependencies] command1 = {path = "./builtins/command1"} command2 = {path = "./builtins/command2"} +read = {path = "./builtins_rust/read"} diff --git a/bash-5.1/builtins/read.def b/bash-5.1/builtins/read.def index 39e16e84..6e1f5375 100644 --- a/bash-5.1/builtins/read.def +++ b/bash-5.1/builtins/read.def @@ -1,23 +1,3 @@ -This file is read.def, from which is created read.c. -It implements the builtin "read" in Bash. - -Copyright (C) 1987-2020 Free Software Foundation, Inc. - -This file is part of GNU Bash, the Bourne Again SHell. - -Bash is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -Bash is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Bash. If not, see . - $PRODUCES read.c $BUILTIN read @@ -112,59 +92,11 @@ $END extern int errno; #endif -struct ttsave -{ - int fd; - TTYSTRUCT attrs; -}; - -#if defined (READLINE) -static void reset_attempted_completion_function PARAMS((char *)); -static int set_itext PARAMS((void)); -static char *edit_line PARAMS((char *, char *)); -static void set_eol_delim PARAMS((int)); -static void reset_eol_delim PARAMS((char *)); -#endif -static SHELL_VAR *bind_read_variable PARAMS((char *, char *)); -#if defined (HANDLE_MULTIBYTE) -static int read_mbchar PARAMS((int, char *, int, int, int)); -#endif -static void ttyrestore PARAMS((struct ttsave *)); - -static sighandler sigalrm PARAMS((int)); -static void reset_alarm PARAMS((void)); +extern int r_read_builtin (WORD_LIST *); -/* Try this to see what the rest of the shell can do with the information. */ procenv_t alrmbuf; int sigalrm_seen; -static int reading, tty_modified; -static SigHandler *old_alrm; -static unsigned char delim; - -static struct ttsave termsave; - -/* In all cases, SIGALRM just sets a flag that we check periodically. This - avoids problems with the semi-tricky stuff we do with the xfree of - input_string at the top of the unwind-protect list (see below). */ - -/* Set a flag that CHECK_ALRM can check. This relies on zread or read_builtin - calling trap.c:check_signals(), which knows about sigalrm_seen and alrmbuf. */ -static sighandler -sigalrm (s) - int s; -{ - sigalrm_seen = 1; -} - -static void -reset_alarm () -{ - /* Cancel alarm before restoring signal handler. */ - falarm (0, 0); - set_signal_handler (SIGALRM, old_alrm); -} - /* Read the value of the shell variables whose names follow. The reading is done from the current input stream, whatever that may be. Successive words of the input line are assigned @@ -175,1016 +107,18 @@ int read_builtin (list) WORD_LIST *list; { - register char *varname; - int size, nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2, nflag; - volatile int i; - int input_is_tty, input_is_pipe, unbuffered_read, skip_ctlesc, skip_ctlnul; - int raw, edit, nchars, silent, have_timeout, ignore_delim, fd; - int lastsig, t_errno; - int mb_cur_max; - unsigned int tmsec, tmusec; - long ival, uval; - intmax_t intval; - char c; - char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname; - char *e, *t, *t1, *ps2, *tofree; - struct stat tsb; - SHELL_VAR *var; - TTYSTRUCT ttattrs, ttset; -#if defined (ARRAY_VARS) - WORD_LIST *alist; - int vflags; -#endif -#if defined (READLINE) - char *rlbuf, *itext; - int rlind; - FILE *save_instream; -#endif - - USE_VAR(size); - USE_VAR(i); - USE_VAR(pass_next); - USE_VAR(print_ps2); - USE_VAR(saw_escape); - USE_VAR(input_is_pipe); -/* USE_VAR(raw); */ - USE_VAR(edit); - USE_VAR(tmsec); - USE_VAR(tmusec); - USE_VAR(nchars); - USE_VAR(silent); - USE_VAR(ifs_chars); - USE_VAR(prompt); - USE_VAR(arrayname); -#if defined (READLINE) - USE_VAR(rlbuf); - USE_VAR(rlind); - USE_VAR(itext); -#endif - USE_VAR(list); - USE_VAR(ps2); - USE_VAR(lastsig); - - sigalrm_seen = reading = tty_modified = 0; - - i = 0; /* Index into the string that we are reading. */ - raw = edit = 0; /* Not reading raw input by default. */ - silent = 0; - arrayname = prompt = (char *)NULL; - fd = 0; /* file descriptor to read from */ - -#if defined (READLINE) - rlbuf = itext = (char *)0; - rlind = 0; -#endif - - mb_cur_max = MB_CUR_MAX; - tmsec = tmusec = 0; /* no timeout */ - nr = nchars = input_is_tty = input_is_pipe = unbuffered_read = have_timeout = 0; - delim = '\n'; /* read until newline */ - ignore_delim = nflag = 0; - - reset_internal_getopt (); - while ((opt = internal_getopt (list, "ersa:d:i:n:p:t:u:N:")) != -1) - { - switch (opt) - { - case 'r': - raw = 1; - break; - case 'p': - prompt = list_optarg; - break; - case 's': - silent = 1; - break; - case 'e': -#if defined (READLINE) - edit = 1; -#endif - break; - case 'i': -#if defined (READLINE) - itext = list_optarg; -#endif - break; -#if defined (ARRAY_VARS) - case 'a': - arrayname = list_optarg; - break; -#endif - case 't': - code = uconvert (list_optarg, &ival, &uval, (char **)NULL); - if (code == 0 || ival < 0 || uval < 0) - { - builtin_error (_("%s: invalid timeout specification"), list_optarg); - return (EXECUTION_FAILURE); - } - else - { - have_timeout = 1; - tmsec = ival; - tmusec = uval; - } - break; - case 'N': - ignore_delim = 1; - delim = -1; - case 'n': - nflag = 1; - code = legal_number (list_optarg, &intval); - if (code == 0 || intval < 0 || intval != (int)intval) - { - sh_invalidnum (list_optarg); - return (EXECUTION_FAILURE); - } - else - nchars = intval; - break; - case 'u': - code = legal_number (list_optarg, &intval); - if (code == 0 || intval < 0 || intval != (int)intval) - { - builtin_error (_("%s: invalid file descriptor specification"), list_optarg); - return (EXECUTION_FAILURE); - } - else - fd = intval; - if (sh_validfd (fd) == 0) - { - builtin_error (_("%d: invalid file descriptor: %s"), fd, strerror (errno)); - return (EXECUTION_FAILURE); - } - break; - case 'd': - delim = *list_optarg; - break; - CASE_HELPOPT; - default: - builtin_usage (); - return (EX_USAGE); - } - } - list = loptend; - - /* `read -t 0 var' tests whether input is available with select/FIONREAD, - and fails if those are unavailable */ - if (have_timeout && tmsec == 0 && tmusec == 0) -#if 0 - return (EXECUTION_FAILURE); -#else - return (input_avail (fd) ? EXECUTION_SUCCESS : EXECUTION_FAILURE); -#endif - - /* Convenience: check early whether or not the first of possibly several - variable names is a valid identifier, and bail early if so. */ -#if defined (ARRAY_VARS) - vflags = assoc_expand_once ? (VA_NOEXPAND|VA_ONEWORD) : 0; - if (list && legal_identifier (list->word->word) == 0 && valid_array_reference (list->word->word, vflags) == 0) -#else - if (list && legal_identifier (list->word->word) == 0) -#endif - { - sh_invalidid (list->word->word); - return (EXECUTION_FAILURE); - } - - /* If we're asked to ignore the delimiter, make sure we do. */ - if (ignore_delim) - delim = -1; - - /* IF IFS is unset, we use the default of " \t\n". */ - ifs_chars = getifs (); - if (ifs_chars == 0) /* XXX - shouldn't happen */ - ifs_chars = ""; - /* If we want to read exactly NCHARS chars, don't split on IFS */ - if (ignore_delim) - ifs_chars = ""; - for (skip_ctlesc = skip_ctlnul = 0, e = ifs_chars; *e; e++) - skip_ctlesc |= *e == CTLESC, skip_ctlnul |= *e == CTLNUL; - - input_string = (char *)xmalloc (size = 112); /* XXX was 128 */ - input_string[0] = '\0'; - - /* More input and options validation */ - if (nflag == 1 && nchars == 0) - { - retval = read (fd, &c, 0); - retval = (retval >= 0) ? EXECUTION_SUCCESS : EXECUTION_FAILURE; - goto assign_vars; /* bail early if asked to read 0 chars */ - } - - /* $TMOUT, if set, is the default timeout for read. */ - if (have_timeout == 0 && (e = get_string_value ("TMOUT"))) - { - code = uconvert (e, &ival, &uval, (char **)NULL); - if (code == 0 || ival < 0 || uval < 0) - tmsec = tmusec = 0; - else - { - tmsec = ival; - tmusec = uval; - } - } - - begin_unwind_frame ("read_builtin"); - -#if defined (BUFFERED_INPUT) - if (interactive == 0 && default_buffered_input >= 0 && fd_is_bash_input (fd)) - sync_buffered_stream (default_buffered_input); -#endif - -#if 1 - input_is_tty = isatty (fd); -#else - input_is_tty = 1; -#endif - if (input_is_tty == 0) -#ifndef __CYGWIN__ - input_is_pipe = (lseek (fd, 0L, SEEK_CUR) < 0) && (errno == ESPIPE); -#else - input_is_pipe = 1; -#endif - - /* If the -p, -e or -s flags were given, but input is not coming from the - terminal, turn them off. */ - if ((prompt || edit || silent) && input_is_tty == 0) - { - prompt = (char *)NULL; -#if defined (READLINE) - itext = (char *)NULL; -#endif - edit = silent = 0; - } - -#if defined (READLINE) - if (edit) - add_unwind_protect (xfree, rlbuf); -#endif - - pass_next = 0; /* Non-zero signifies last char was backslash. */ - saw_escape = 0; /* Non-zero signifies that we saw an escape char */ - - if (tmsec > 0 || tmusec > 0) - { - /* Turn off the timeout if stdin is a regular file (e.g. from - input redirection). */ - if ((fstat (fd, &tsb) < 0) || S_ISREG (tsb.st_mode)) - tmsec = tmusec = 0; - } - - if (tmsec > 0 || tmusec > 0) - { - code = setjmp_nosigs (alrmbuf); - if (code) - { - sigalrm_seen = 0; - /* Tricky. The top of the unwind-protect stack is the free of - input_string. We want to run all the rest and use input_string, - so we have to save input_string temporarily, run the unwind- - protects, then restore input_string so we can use it later */ - orig_input_string = 0; - input_string[i] = '\0'; /* make sure it's terminated */ - if (i == 0) - { - t = (char *)xmalloc (1); - t[0] = 0; - } - else - t = savestring (input_string); - - run_unwind_frame ("read_builtin"); - input_string = t; - retval = 128+SIGALRM; - goto assign_vars; - } - if (interactive_shell == 0) - initialize_terminating_signals (); - old_alrm = set_signal_handler (SIGALRM, sigalrm); - add_unwind_protect (reset_alarm, (char *)NULL); -#if defined (READLINE) - if (edit) - { - add_unwind_protect (reset_attempted_completion_function, (char *)NULL); - add_unwind_protect (bashline_reset_event_hook, (char *)NULL); - } -#endif - falarm (tmsec, tmusec); - } - - /* If we've been asked to read only NCHARS chars, or we're using some - character other than newline to terminate the line, do the right - thing to readline or the tty. */ - if (nchars > 0 || delim != '\n') - { -#if defined (READLINE) - if (edit) - { - if (nchars > 0) - { - unwind_protect_int (rl_num_chars_to_read); - rl_num_chars_to_read = nchars; - } - if (delim != '\n') - { - set_eol_delim (delim); - add_unwind_protect (reset_eol_delim, (char *)NULL); - } - } - else -#endif - if (input_is_tty) - { - /* ttsave() */ - termsave.fd = fd; - ttgetattr (fd, &ttattrs); - termsave.attrs = ttattrs; - - ttset = ttattrs; - i = silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset); - if (i < 0) - sh_ttyerror (1); - tty_modified = 1; - add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); - if (interactive_shell == 0) - initialize_terminating_signals (); - } - } - else if (silent) /* turn off echo but leave term in canonical mode */ - { - /* ttsave (); */ - termsave.fd = fd; - ttgetattr (fd, &ttattrs); - termsave.attrs = ttattrs; - - ttset = ttattrs; - i = ttfd_noecho (fd, &ttset); /* ttnoecho (); */ - if (i < 0) - sh_ttyerror (1); - - tty_modified = 1; - add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); - if (interactive_shell == 0) - initialize_terminating_signals (); - } - -#if defined (READLINE) - save_instream = 0; - if (edit && fd != 0) - { - if (bash_readline_initialized == 0) - initialize_readline (); - - unwind_protect_var (rl_instream); - save_instream = rl_instream; - rl_instream = fdopen (fd, "r"); - } -#endif - - /* This *must* be the top unwind-protect on the stack, so the manipulation - of the unwind-protect stack after the realloc() works right. */ - add_unwind_protect (xfree, input_string); - - CHECK_ALRM; - if ((nchars > 0) && (input_is_tty == 0) && ignore_delim) /* read -N */ - unbuffered_read = 2; - else if ((nchars > 0) || (delim != '\n') || input_is_pipe) - unbuffered_read = 1; - - if (prompt && edit == 0) - { - fprintf (stderr, "%s", prompt); - fflush (stderr); - } - -#if defined (__CYGWIN__) && defined (O_TEXT) - setmode (0, O_TEXT); -#endif - - ps2 = 0; - for (print_ps2 = eof = retval = 0;;) - { - CHECK_ALRM; - -#if defined (READLINE) - if (edit) - { - /* If we have a null delimiter, don't treat NULL as ending the line */ - if (rlbuf && rlbuf[rlind] == '\0' && delim != '\0') - { - free (rlbuf); - rlbuf = (char *)0; - } - if (rlbuf == 0) - { - reading = 1; - rlbuf = edit_line (prompt ? prompt : "", itext); - reading = 0; - rlind = 0; - } - if (rlbuf == 0) - { - eof = 1; - break; - } - c = rlbuf[rlind++]; - } - else - { -#endif - - if (print_ps2) - { - if (ps2 == 0) - ps2 = get_string_value ("PS2"); - fprintf (stderr, "%s", ps2 ? ps2 : ""); - fflush (stderr); - print_ps2 = 0; - } - - reading = 1; - CHECK_ALRM; - errno = 0; - if (unbuffered_read == 2) - retval = posixly_correct ? zreadintr (fd, &c, 1) : zreadn (fd, &c, nchars - nr); - else if (unbuffered_read) - retval = posixly_correct ? zreadintr (fd, &c, 1) : zread (fd, &c, 1); - else - retval = posixly_correct ? zreadcintr (fd, &c) : zreadc (fd, &c); - reading = 0; - - if (retval <= 0) - { - int t; - - t = errno; - if (retval < 0 && errno == EINTR) - { - check_signals (); /* in case we didn't call zread via zreadc */ - lastsig = LASTSIG(); - if (lastsig == 0) - lastsig = trapped_signal_received; -#if 0 - run_pending_traps (); /* because interrupt_immediately is not set */ -#endif - } - else - lastsig = 0; - if (terminating_signal && tty_modified) - ttyrestore (&termsave); /* fix terminal before exiting */ - CHECK_TERMSIG; - eof = 1; - errno = t; /* preserve it for the error message below */ - break; - } - - QUIT; /* in case we didn't call check_signals() */ -#if defined (READLINE) - } -#endif - - if (retval <= 0) /* XXX shouldn't happen */ - CHECK_ALRM; - - /* XXX -- use i + mb_cur_max (at least 4) for multibyte/read_mbchar */ - if (i + (mb_cur_max > 4 ? mb_cur_max : 4) >= size) - { - char *t; - t = (char *)xrealloc (input_string, size += 128); - - /* Only need to change unwind-protect if input_string changes */ - if (t != input_string) - { - input_string = t; - remove_unwind_protect (); - add_unwind_protect (xfree, input_string); - } - } - - /* If the next character is to be accepted verbatim, a backslash - newline pair still disappears from the input. */ - if (pass_next) - { - pass_next = 0; - if (c == '\n') - { - if (skip_ctlesc == 0 && i > 0) - i--; /* back up over the CTLESC */ - if (interactive && input_is_tty && raw == 0) - print_ps2 = 1; - } - else - goto add_char; - continue; - } - - /* This may cause problems if IFS contains CTLESC */ - if (c == '\\' && raw == 0) - { - pass_next++; - if (skip_ctlesc == 0) - { - saw_escape++; - input_string[i++] = CTLESC; - } - continue; - } - - if (ignore_delim == 0 && (unsigned char)c == delim) - break; - - if (c == '\0' && delim != '\0') - continue; /* skip NUL bytes in input */ - - if ((skip_ctlesc == 0 && c == CTLESC) || (skip_ctlnul == 0 && c == CTLNUL)) - { - saw_escape++; - input_string[i++] = CTLESC; - } - -add_char: - input_string[i++] = c; - CHECK_ALRM; - -#if defined (HANDLE_MULTIBYTE) - /* XXX - what if C == 127? Can DEL introduce a multibyte sequence? */ - if (mb_cur_max > 1 && is_basic (c) == 0) - { - input_string[i] = '\0'; /* for simplicity and debugging */ - /* If we got input from readline, grab the next multibyte char from - rlbuf. */ -# if defined (READLINE) - if (edit) - { - size_t clen; - clen = mbrlen (rlbuf + rlind - 1, mb_cur_max, (mbstate_t *)NULL); - /* We only deal with valid multibyte sequences longer than one - byte. If we get anything else, we leave the one character - copied and move on to the next. */ - if ((int)clen > 1) - { - memcpy (input_string+i, rlbuf+rlind, clen-1); - i += clen - 1; - rlind += clen - 1; - } - } - else -# endif - if (locale_utf8locale == 0 || ((c & 0x80) != 0)) - i += read_mbchar (fd, input_string, i, c, unbuffered_read); - } -#endif - - nr++; - - if (nchars > 0 && nr >= nchars) - break; - } - input_string[i] = '\0'; - CHECK_ALRM; - -#if defined (READLINE) - if (edit) - free (rlbuf); -#endif - - if (retval < 0) - { - t_errno = errno; - if (errno != EINTR) - builtin_error (_("read error: %d: %s"), fd, strerror (errno)); - run_unwind_frame ("read_builtin"); - return ((t_errno != EINTR) ? EXECUTION_FAILURE : 128+lastsig); - } - - if (tmsec > 0 || tmusec > 0) - reset_alarm (); - - if (nchars > 0 || delim != '\n') - { -#if defined (READLINE) - if (edit) - { - if (nchars > 0) - rl_num_chars_to_read = 0; - if (delim != '\n') - reset_eol_delim ((char *)NULL); - } - else -#endif - if (input_is_tty) - ttyrestore (&termsave); - } - else if (silent) - ttyrestore (&termsave); - - if (unbuffered_read == 0) - zsyncfd (fd); - -#if defined (READLINE) - if (save_instream) - rl_instream = save_instream; /* can't portably free it */ -#endif - - discard_unwind_frame ("read_builtin"); - - retval = eof ? EXECUTION_FAILURE : EXECUTION_SUCCESS; - -assign_vars: - -#if defined (ARRAY_VARS) - /* If -a was given, take the string read, break it into a list of words, - an assign them to `arrayname' in turn. */ - if (arrayname) - { - if (legal_identifier (arrayname) == 0) - { - sh_invalidid (arrayname); - free (input_string); - return (EXECUTION_FAILURE); - } - - var = find_or_make_array_variable (arrayname, 1); - if (var == 0) - { - free (input_string); - return EXECUTION_FAILURE; /* readonly or noassign */ - } - if (assoc_p (var)) - { - builtin_error (_("%s: cannot convert associative to indexed array"), arrayname); - free (input_string); - return EXECUTION_FAILURE; /* existing associative array */ - } - else if (invisible_p (var)) - VUNSETATTR (var, att_invisible); - array_flush (array_cell (var)); - - alist = list_string (input_string, ifs_chars, 0); - if (alist) - { - if (saw_escape) - dequote_list (alist); - else - word_list_remove_quoted_nulls (alist); - assign_array_var_from_word_list (var, alist, 0); - dispose_words (alist); - } - free (input_string); - return (retval); - } -#endif /* ARRAY_VARS */ - - /* If there are no variables, save the text of the line read to the - variable $REPLY. ksh93 strips leading and trailing IFS whitespace, - so that `read x ; echo "$x"' and `read ; echo "$REPLY"' behave the - same way, but I believe that the difference in behaviors is useful - enough to not do it. Without the bash behavior, there is no way - to read a line completely without interpretation or modification - unless you mess with $IFS (e.g., setting it to the empty string). - If you disagree, change the occurrences of `#if 0' to `#if 1' below. */ - if (list == 0) - { -#if 0 - orig_input_string = input_string; - for (t = input_string; ifs_chars && *ifs_chars && spctabnl(*t) && isifs(*t); t++) - ; - input_string = t; - input_string = strip_trailing_ifs_whitespace (input_string, ifs_chars, saw_escape); -#endif - - if (saw_escape) - { - t = dequote_string (input_string); - var = bind_variable ("REPLY", t, 0); - free (t); - } - else - var = bind_variable ("REPLY", input_string, 0); - if (var == 0 || readonly_p (var) || noassign_p (var)) - retval = EXECUTION_FAILURE; - else - VUNSETATTR (var, att_invisible); - - free (input_string); - return (retval); - } - - /* This code implements the Posix.2 spec for splitting the words - read and assigning them to variables. */ - orig_input_string = input_string; - - /* Remove IFS white space at the beginning of the input string. If - $IFS is null, no field splitting is performed. */ - for (t = input_string; ifs_chars && *ifs_chars && spctabnl(*t) && isifs(*t); t++) - ; - input_string = t; - for (; list->next; list = list->next) - { - varname = list->word->word; -#if defined (ARRAY_VARS) - if (legal_identifier (varname) == 0 && valid_array_reference (varname, vflags) == 0) -#else - if (legal_identifier (varname) == 0) -#endif - { - sh_invalidid (varname); - free (orig_input_string); - return (EXECUTION_FAILURE); - } - - /* If there are more variables than words read from the input, - the remaining variables are set to the empty string. */ - if (*input_string) - { - /* This call updates INPUT_STRING. */ - t = get_word_from_string (&input_string, ifs_chars, &e); - if (t) - *e = '\0'; - /* Don't bother to remove the CTLESC unless we added one - somewhere while reading the string. */ - if (t && saw_escape) - { - t1 = dequote_string (t); - var = bind_read_variable (varname, t1); - free (t1); - } - else - var = bind_read_variable (varname, t ? t : ""); - } - else - { - t = (char *)0; - var = bind_read_variable (varname, ""); - } - - FREE (t); - if (var == 0) - { - free (orig_input_string); - return (EXECUTION_FAILURE); - } - - stupidly_hack_special_variables (varname); - VUNSETATTR (var, att_invisible); - } - - /* Now assign the rest of the line to the last variable argument. */ -#if defined (ARRAY_VARS) - if (legal_identifier (list->word->word) == 0 && valid_array_reference (list->word->word, vflags) == 0) -#else - if (legal_identifier (list->word->word) == 0) -#endif - { - sh_invalidid (list->word->word); - free (orig_input_string); - return (EXECUTION_FAILURE); - } - -#if 0 - /* This has to be done this way rather than using string_list - and list_string because Posix.2 says that the last variable gets the - remaining words and their intervening separators. */ - input_string = strip_trailing_ifs_whitespace (input_string, ifs_chars, saw_escape); -#else - /* Check whether or not the number of fields is exactly the same as the - number of variables. */ - tofree = NULL; - if (*input_string) - { - t1 = input_string; - t = get_word_from_string (&input_string, ifs_chars, &e); - if (*input_string == 0) - tofree = input_string = t; - else - { - input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape); - tofree = t; - } - } -#endif - - if (saw_escape && input_string && *input_string) - { - t = dequote_string (input_string); - var = bind_read_variable (list->word->word, t); - free (t); - } - else - var = bind_read_variable (list->word->word, input_string ? input_string : ""); - - if (var) - { - stupidly_hack_special_variables (list->word->word); - VUNSETATTR (var, att_invisible); - } - else - retval = EXECUTION_FAILURE; - - FREE (tofree); - free (orig_input_string); - - return (retval); -} - -static SHELL_VAR * -bind_read_variable (name, value) - char *name, *value; -{ - SHELL_VAR *v; - - v = builtin_bind_variable (name, value, 0); - return (v == 0 ? v - : ((readonly_p (v) || noassign_p (v)) ? (SHELL_VAR *)NULL : v)); -} - -#if defined (HANDLE_MULTIBYTE) -static int -read_mbchar (fd, string, ind, ch, unbuffered) - int fd; - char *string; - int ind, ch, unbuffered; -{ - char mbchar[MB_LEN_MAX + 1]; - int i, n, r; - char c; - size_t ret; - mbstate_t ps, ps_back; - wchar_t wc; - - memset (&ps, '\0', sizeof (mbstate_t)); - memset (&ps_back, '\0', sizeof (mbstate_t)); - - mbchar[0] = ch; - i = 1; - for (n = 0; n <= MB_LEN_MAX; n++) - { - ps_back = ps; - ret = mbrtowc (&wc, mbchar, i, &ps); - if (ret == (size_t)-2) - { - ps = ps_back; - - /* We don't want to be interrupted during a multibyte char read */ - if (unbuffered == 2) - r = zreadn (fd, &c, 1); - else if (unbuffered) - r = zread (fd, &c, 1); - else - r = zreadc (fd, &c); - if (r <= 0) - goto mbchar_return; - mbchar[i++] = c; - continue; - } - else if (ret == (size_t)-1 || ret == (size_t)0 || ret > (size_t)0) - break; - } - -mbchar_return: - if (i > 1) /* read a multibyte char */ - /* mbchar[0] is already string[ind-1] */ - for (r = 1; r < i; r++) - string[ind+r-1] = mbchar[r]; - return i - 1; -} -#endif - - -static void -ttyrestore (ttp) - struct ttsave *ttp; -{ - ttsetattr (ttp->fd, &(ttp->attrs)); - tty_modified = 0; + r_read_builtin(list); } void read_tty_cleanup () { - if (tty_modified) - ttyrestore (&termsave); + ; } int read_tty_modified () { - return (tty_modified); -} - -#if defined (READLINE) -static rl_completion_func_t *old_attempted_completion_function = 0; -static rl_hook_func_t *old_startup_hook; -static char *deftext; - -static void -reset_attempted_completion_function (cp) - char *cp; -{ - if (rl_attempted_completion_function == 0 && old_attempted_completion_function) - rl_attempted_completion_function = old_attempted_completion_function; -} - -static int -set_itext () -{ - int r1, r2; - - r1 = r2 = 0; - if (old_startup_hook) - r1 = (*old_startup_hook) (); - if (deftext) - { - r2 = rl_insert_text (deftext); - deftext = (char *)NULL; - rl_startup_hook = old_startup_hook; - old_startup_hook = (rl_hook_func_t *)NULL; - } - return (r1 || r2); + return 0; } -static char * -edit_line (p, itext) - char *p; - char *itext; -{ - char *ret; - int len; - - if (bash_readline_initialized == 0) - initialize_readline (); - - old_attempted_completion_function = rl_attempted_completion_function; - rl_attempted_completion_function = (rl_completion_func_t *)NULL; - bashline_set_event_hook (); - if (itext) - { - old_startup_hook = rl_startup_hook; - rl_startup_hook = set_itext; - deftext = itext; - } - - ret = readline (p); - - rl_attempted_completion_function = old_attempted_completion_function; - old_attempted_completion_function = (rl_completion_func_t *)NULL; - bashline_reset_event_hook (); - - if (ret == 0) - return ret; - len = strlen (ret); - ret = (char *)xrealloc (ret, len + 2); - ret[len++] = delim; - ret[len] = '\0'; - return ret; -} - -static int old_delim_ctype; -static rl_command_func_t *old_delim_func; -static int old_newline_ctype; -static rl_command_func_t *old_newline_func; - -static unsigned char delim_char; - -static void -set_eol_delim (c) - int c; -{ - Keymap cmap; - - if (bash_readline_initialized == 0) - initialize_readline (); - cmap = rl_get_keymap (); - - /* Save the old delimiter char binding */ - old_newline_ctype = cmap[RETURN].type; - old_newline_func = cmap[RETURN].function; - old_delim_ctype = cmap[c].type; - old_delim_func = cmap[c].function; - - /* Change newline to self-insert */ - cmap[RETURN].type = ISFUNC; - cmap[RETURN].function = rl_insert; - - /* Bind the delimiter character to accept-line. */ - cmap[c].type = ISFUNC; - cmap[c].function = rl_newline; - - delim_char = c; -} - -static void -reset_eol_delim (cp) - char *cp; -{ - Keymap cmap; - - cmap = rl_get_keymap (); - - cmap[RETURN].type = old_newline_ctype; - cmap[RETURN].function = old_newline_func; - - cmap[delim_char].type = old_delim_ctype; - cmap[delim_char].function = old_delim_func; -} -#endif diff --git a/bash-5.1/builtins_rust/jobs/Cargo.toml b/bash-5.1/builtins_rust/jobs/Cargo.toml index d07d3572..fa26bda5 100644 --- a/bash-5.1/builtins_rust/jobs/Cargo.toml +++ b/bash-5.1/builtins_rust/jobs/Cargo.toml @@ -2,7 +2,7 @@ authors = ["huzhengming"] name = "rjobs" version = "0.0.1" -build = "build.rs" +build = "../build.rs" edition = "2021" diff --git a/record.txt b/record.txt index cc66e279..da211e38 100644 --- a/record.txt +++ b/record.txt @@ -21,3 +21,4 @@ 15 16 17 +18 -- Gitee From fbb0009e5ccee1a9a0e2c6c6ce5e2a998394068b Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Wed, 14 Jun 2023 11:05:38 +0800 Subject: [PATCH 12/12] refactor: add r_execute_cmd function --- bash-5.1/Cargo.toml | 3 +++ bash-5.1/configure | 3 ++- bash-5.1/execute_cmd.c | 4 +++- bash-5.1/rsbuiltins.h | 2 -- bash-5.1/src/lib.rs | 39 +-------------------------------------- record.txt | 1 + 6 files changed, 10 insertions(+), 42 deletions(-) diff --git a/bash-5.1/Cargo.toml b/bash-5.1/Cargo.toml index 3c97c62e..48dca7e2 100644 --- a/bash-5.1/Cargo.toml +++ b/bash-5.1/Cargo.toml @@ -2,6 +2,9 @@ name = "rsbash" version = "0.1.0" edition = "2021" +[lib] +name = "rsbash" +crate-type = ["cdylib"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [workspace] diff --git a/bash-5.1/configure b/bash-5.1/configure index 0f1d3ed1..0d917697 100755 --- a/bash-5.1/configure +++ b/bash-5.1/configure @@ -4231,7 +4231,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$want_auto_cflags"; then AUTO_CFLAGS="-g ${GCC+-O2}" AUTO_LDFLAGS="-g ${GCC+-O2}" - STYLE_CFLAGS="${GCC+-Wno-parentheses} ${GCC+-Wno-format-security}" + STYLE_CFLAGS="${GCC+-Wno-parentheses} ${GCC+-Wno-format-security} ${GCC+-fPIC}" else AUTO_CFLAGS= AUTO_LDFLAGS= STYLE_CFLAGS= fi @@ -20255,6 +20255,7 @@ fi $as_echo "using $bash_cv_termcap_lib" >&6; } if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then LDFLAGS="$LDFLAGS -L./lib/termcap" + TERMCAP_LIB="./lib/termcap/libtermcap.a" TERMCAP_DEP="./lib/termcap/libtermcap.a" elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then diff --git a/bash-5.1/execute_cmd.c b/bash-5.1/execute_cmd.c index c86c1a07..ecd509c3 100644 --- a/bash-5.1/execute_cmd.c +++ b/bash-5.1/execute_cmd.c @@ -110,6 +110,8 @@ extern int errno; # include /* mbschr */ #endif +# include "./rsbuiltins.h" + extern int command_string_index; extern char *the_printed_command; extern time_t shell_start_time; @@ -4735,6 +4737,7 @@ execute_builtin (builtin, words, flags, subshell) error_trap = 0; should_keep = 0; + r_execute_cmd(); /* The eval builtin calls parse_and_execute, which does not know about the setting of flags, and always calls the execution functions with flags that will exit the shell on an error if -e is set. If the @@ -5308,7 +5311,6 @@ execute_builtin_or_function (words, builtin, var, redirects, int ofifo, nfifo, osize; void *ofifo_list; #endif - #if defined (PROCESS_SUBSTITUTION) begin_unwind_frame ("saved_fifos"); /* If we return, we longjmp and don't get a chance to restore the old diff --git a/bash-5.1/rsbuiltins.h b/bash-5.1/rsbuiltins.h index f6f3be36..f3b7f9be 100644 --- a/bash-5.1/rsbuiltins.h +++ b/bash-5.1/rsbuiltins.h @@ -1,4 +1,2 @@ #include -#include "command.h" int r_execute_cmd(); -int r_execute_cmd2(WORD_LIST *l); diff --git a/bash-5.1/src/lib.rs b/bash-5.1/src/lib.rs index 39f431c5..874f7e60 100644 --- a/bash-5.1/src/lib.rs +++ b/bash-5.1/src/lib.rs @@ -1,42 +1,5 @@ -use libc::{c_char, c_int, c_long}; -use std::ffi::CStr; -use std::str; - -#[repr(C)] -pub struct WORD_DESC { - pub word : *mut c_char, - pub flags : c_int -} - -#[repr(C)] -#[derive(Copy, Clone)] -pub struct WORD_LIST { - next : *mut WORD_LIST, - word : *mut WORD_DESC -} - - -//#[link(name = "")] -//extern { - // pub fn printf( #[no_mangle] pub extern "C" fn r_execute_cmd() { - //println!("hello"); - //common::builtin_error("test error") + println!("hello"); } -#[no_mangle] -pub extern "C" fn r_execute_cmd2(l : *mut WORD_LIST) -> i32 { - unsafe { - let mut it : *mut WORD_LIST = l; - while std::ptr::null() != it { - //let mut a = (&((* ((*l).word)).word) ); - let mut a :*mut c_char =( *(*it).word).word; - let c_str: &CStr = CStr::from_ptr(a); - let str_slice: &str = c_str.to_str().unwrap(); - println! ("word is {:?}", str_slice); - it = (*it).next; - } - } - 0 -} diff --git a/record.txt b/record.txt index da211e38..8409e1a0 100644 --- a/record.txt +++ b/record.txt @@ -22,3 +22,4 @@ 16 17 18 +19 -- Gitee