eval

读取并执行多个命令/参数

语法

  eval [arguments]

参数说明:参数不限数目,彼此之间用分号分开
eval会对后面的arguments进行两遍扫描,如果第一遍扫描后,arguments是个普通命令,则执行此命令;如果arguments中含有变量的间接引用,则保证间接引用的语义

实例

eval enable;ls

eval 命令实例:

linux命令:eval "unset $(printenv | grep -ioP '(?:https?|no)_proxy' | tr '\n' ' ')" ')" ' '\n' tr | '(?:https?|no)_proxy' -ioP grep | $(printenv "unset eval eval "unset $(printenv | grep -ioP '(?:https?|no)_proxy' | tr '\n' ' ')"rootopen.com
linux命令:eval "unset $(printenv | grep -ioP '(?:https?|no)_proxy' | tr '\n' ' ')" ')" ' '\n' tr | '(?:https?|no)_proxy' -ioP grep | $(printenv "unset eval eval "unset $(printenv | grep -ioP '(?:https?|no)_proxy' | tr '\n' ' ')"rootopen.com
2019-07-09 21:22:22

linux命令:eval "`dircolors -b`" -b`" "`dircolors eval eval "`dircolors -b`"rootopen.com
linux命令:eval "`dircolors -b`" -b`" "`dircolors eval eval "`dircolors -b`"rootopen.com
2018-05-09 02:09:48

linux命令:eval $(sed -n "s/^d[^D]*DB_\([NUPH]\)[ASO].*',[^']*'\([^']*\)'.*/_\1='\2'/p" wp-config.php) && mysqldump --opt --add-drop-table -u$_U -p$_P -h$_H $_N | gpg -er AskApache >`date +%m%d%y-%H%M.$_N.sqls` +%m%d%y-%H%M.$_N.sqls` >`date AskApache -er gpg | $_N -h$_H -p$_P -u$_U --add-drop-table --opt mysqldump && wp-config.php) "s/^d[^D]*DB_\([NUPH]\)[ASO].*',[^']*'\([^']*\)'.*/_\1='\2'/p" -n $(sed eval eval $(sed -n "s/^d[^D]*DB_\([NUPH]\)[ASO].*',[^']*'\([^']*\)'.*/_\1='\2'/p" wp-config.php) && mysqldump --opt --add-drop-table -u$_U -p$_P -h$_H $_N | gpg -er AskApache >`date +%m%d%y-%H%M.$_N.sqls`rootopen.com
linux命令:eval $(sed -n "s/^d[^D]*DB_\([NUPH]\)[ASO].*',[^']*'\([^']*\)'.*/_\1='\2'/p" wp-config.php) && mysqldump --opt --add-drop-table -u$_U -p$_P -h$_H $_N | gpg -er AskApache >`date +%m%d%y-%H%M.$_N.sqls` +%m%d%y-%H%M.$_N.sqls` >`date AskApache -er gpg | $_N -h$_H -p$_P -u$_U --add-drop-table --opt mysqldump && wp-config.php) "s/^d[^D]*DB_\([NUPH]\)[ASO].*',[^']*'\([^']*\)'.*/_\1='\2'/p" -n $(sed eval eval $(sed -n "s/^d[^D]*DB_\([NUPH]\)[ASO].*',[^']*'\([^']*\)'.*/_\1='\2'/p" wp-config.php) && mysqldump --opt --add-drop-table -u$_U -p$_P -h$_H $_N | gpg -er AskApache >`date +%m%d%y-%H%M.$_N.sqls`rootopen.com
2018-01-26 10:58:48

linux命令:eval `ssh-agent`; screen screen `ssh-agent`; eval eval `ssh-agent`; screenrootopen.com
linux命令:eval `ssh-agent`; screen screen `ssh-agent`; eval eval `ssh-agent`; screenrootopen.com
2018-04-12 05:49:48

linux命令:eval ls -l /proc/{$(pgrep -d, COMMAND)}/cwd COMMAND)}/cwd -d, /proc/{$(pgrep -l ls eval eval ls -l /proc/{$(pgrep -d, COMMAND)}/cwdrootopen.com
linux命令:eval ls -l /proc/{$(pgrep -d, COMMAND)}/cwd COMMAND)}/cwd -d, /proc/{$(pgrep -l ls eval eval ls -l /proc/{$(pgrep -d, COMMAND)}/cwdrootopen.com
2018-05-26 16:07:48

linux命令:eval "mkdir test{$(seq -s, 1 10)}" 10)}" 1 -s, test{$(seq "mkdir eval eval "mkdir test{$(seq -s, 1 10)}"rootopen.com
linux命令:eval "mkdir test{$(seq -s, 1 10)}" 10)}" 1 -s, test{$(seq "mkdir eval eval "mkdir test{$(seq -s, 1 10)}"rootopen.com
2018-05-18 11:41:48

linux命令:eval $(date +"day=%d; month=%m; year=%y") year=%y") month=%m; +"day=%d; $(date eval eval $(date +"day=%d; month=%m; year=%y")rootopen.com
linux命令:eval $(date +"day=%d; month=%m; year=%y") year=%y") month=%m; +"day=%d; $(date eval eval $(date +"day=%d; month=%m; year=%y")rootopen.com
2018-02-02 09:58:48

linux命令:eval <command> ${INBACK:-&} ${INBACK:-&} <command> eval eval <command> ${INBACK:-&}rootopen.com
linux命令:eval <command> ${INBACK:-&} ${INBACK:-&} <command> eval eval <command> ${INBACK:-&}rootopen.com
2018-04-08 11:45:48

linux命令:eval `ls -1d * | awk '{print "zip -r "$1".zip "$1";"}'` "$1";"}'` "$1".zip -r "zip '{print awk | * -1d `ls eval eval `ls -1d * | awk '{print "zip -r "$1".zip "$1";"}'`rootopen.com
linux命令:eval `ls -1d * | awk '{print "zip -r "$1".zip "$1";"}'` "$1";"}'` "$1".zip -r "zip '{print awk | * -1d `ls eval eval `ls -1d * | awk '{print "zip -r "$1".zip "$1";"}'`rootopen.com
2018-01-31 00:08:48

linux命令:eval $(history | cut -c 8- | grep "adb connect [0-9]" | tail -1) -1) tail | [0-9]" connect "adb grep | 8- -c cut | $(history eval eval $(history | cut -c 8- | grep "adb connect [0-9]" | tail -1)rootopen.com
linux命令:eval $(history | cut -c 8- | grep "adb connect [0-9]" | tail -1) -1) tail | [0-9]" connect "adb grep | 8- -c cut | $(history eval eval $(history | cut -c 8- | grep "adb connect [0-9]" | tail -1)rootopen.com
2017-12-31 16:11:48

linux命令:eval echo $(echoprint-codegen "/path/to/file.mp3"| jq ' .[0].metadata | "mp3info -a \"" + .artist + "\" -t \"" + .title + "\" -l \"" + .release + "\" \"" + .filename + "\"" ' ) | bash bash | ) ' "\"" + .filename + \"" "\" + .release + \"" -l "\" + .title + \"" -t "\" + .artist + \"" -a "mp3info | .[0].metadata ' jq "/path/to/file.mp3"| $(echoprint-codegen echo eval eval echo $(echoprint-codegen "/path/to/file.mp3"| jq ' .[0].metadata | "mp3info -a \"" + .artist + "\" -t \"" + .title + "\" -l \"" + .release + "\" \"" + .filename + "\"" ' ) | bashrootopen.com
linux命令:eval echo $(echoprint-codegen "/path/to/file.mp3"| jq ' .[0].metadata | "mp3info -a \"" + .artist + "\" -t \"" + .title + "\" -l \"" + .release + "\" \"" + .filename + "\"" ' ) | bash bash | ) ' "\"" + .filename + \"" "\" + .release + \"" -l "\" + .title + \"" -t "\" + .artist + \"" -a "mp3info | .[0].metadata ' jq "/path/to/file.mp3"| $(echoprint-codegen echo eval eval echo $(echoprint-codegen "/path/to/file.mp3"| jq ' .[0].metadata | "mp3info -a \"" + .artist + "\" -t \"" + .title + "\" -l \"" + .release + "\" \"" + .filename + "\"" ' ) | bashrootopen.com
2018-05-02 16:47:48

Linux的Bash命令行(A-Z排序)