分页: 1 / 1
[问题]"()" and "{}"
发表于 : 2006-04-10 1:49
由 LinuxPing
先在你的桌面建一个文本文件English ,随便输入点什么。。
在终端输入: debian_chroot=$(cat ~/Desktop/English)
没有错误提示~
在终端输入: debian_chroot=${cat ~/Desktop/English}
提示错误:bad substitution ---错误的替换。
()和 {} 区别是什么?
发表于 : 2006-04-10 1:55
由 LinuxPing
第2个问题:
#shellScript:
[ -z "$PS1" ] && return
shopt -s checkwinsize
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
问题:shopt 什么东西?eval 什么东西?
$(lesspipe) 为什么用(),而不是${lesspipe}?
发表于 : 2006-04-10 10:43
由 leal
$(command) 返回command执行后的结果
${VAR} 等同于 $VAR ,取出变量VAR的值
发表于 : 2006-04-11 9:55
由 LinuxPing
谢~~
但还有问题你 没回答~~
发表于 : 2006-04-11 10:23
由 leal
善用man
发表于 : 2006-04-11 14:47
由 LinuxPing
man shopt --------- man eval什么都没有!!!(找不到帮助目录~)
发表于 : 2006-04-12 11:22
由 windforest
shopt, eval都是bash内嵌命令
看它们的帮助用help
如help shopt
发表于 : 2006-05-30 19:04
由 zhan
所谓的用man的意思就是
man bash
发表于 : 2006-10-08 15:13
由 zbspeed
Syntax
======
eval arg [arg ...]
Description
===========
eval takes one or more arguments, which together comprise a Tcl script
containing one or more commands. eval concatenates all its arguments in the
same fashion as the concat command, passes the concatenated string to the
Tcl interpreter recursively, and returns the result of that evaluation (or
any error generated by it).
发表于 : 2006-10-09 18:32
由 bones7456
那$(command)和`command`有什么区别?
据我所知没啥大的区别
发表于 : 2006-10-13 12:42
由 echo_mu
$()这种格式更新一些,更容易嵌套使用。
发表于 : 2006-10-13 19:44
由 aBiNg
$'command'
>command
单引号的作用是只做字面输出,不作shell解释...
发表于 : 2006-10-15 16:54
由 echo_mu
don-quixote 写了:$'command'
>command
单引号的作用是只做字面输出,不作shell解释...
那不是单引号,是esc下面那个键
发表于 : 2006-10-15 21:03
由 aBiNg
echo_mu 写了:don-quixote 写了:$'command'
>command
单引号的作用是只做字面输出,不作shell解释...
那不是单引号,是esc下面那个键
不好意思~
