LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1581|回复: 18

脑筋急转弯儿 - 再请大家试一试

[复制链接]
发表于 2003-11-16 23:20:20 | 显示全部楼层 |阅读模式
上回的小测验吸引了几位兄弟来捧场,多谢了。出题的目的不是想难倒大家,而是想
活跃一下坛子的气氛,对UNIX一些基础的基础有一定的了解。看完了题,回机器上
一试就有结果。知道结果后,最好想想为什么,那我们的目的就达到了。

这回再给大家出个小题目,条件和上回一样,另外请大家看完题目先做题,后看其
它人的帖子:

在shell 工作情况下,请给举个“command"的例子,这个command是一个shell 的"built
in fonction", 而不是一个”system call"。

a. 看完之后张口就出的,得满分(当然要对了)
b. 1分钟内给正确答案的得80分
c. 10分钟内给正确答案的得60分
d. 不知我在说什么的,不及格啦。。。
发表于 2003-11-16 23:40:45 | 显示全部楼层
cd
发表于 2003-11-16 23:40:58 | 显示全部楼层
cd?
发表于 2003-11-16 23:42:13 | 显示全部楼层
晚了:(
bash
export
发表于 2003-11-17 00:03:56 | 显示全部楼层
libtool
 楼主| 发表于 2003-11-17 01:08:41 | 显示全部楼层
我说javalee老大,这题您不该答得这么快 ;P,您应该在有的兄弟不懂的情况下给大家解释为什么。 现在这题只好换成: 为什么是。。。了? 哈哈。。
发表于 2003-11-17 01:37:17 | 显示全部楼层
builtin, alias, alloc, bg, bindkey, break, breaksw, builtins, case, cd,
     chdir, command, complete, continue, default, dirs, do, done, echo,
     echotc, elif, else, end, endif, endsw, esac, eval, exec, exit, export,
     false, fc, fg, filetest, fi, for, foreach, getopts, glob, goto, hash,
     hashstat, history, hup, if, jobid, jobs, kill, limit, log, login, logout,
     ls-F, nice, nohup, notify, onintr, popd, printenv, printf, pushd, pwd,
     read, readonly, rehash, repeat, sched, set, setenv, settc, setty, setvar,
     shift, source, stop, suspend, switch, telltc, test, then, time, trap,
     true, type, ulimit, umask, unalias, uncomplete, unhash, unlimit, unset,
     unsetenv, until, wait, where, which, while -- shell builtin commands
 楼主| 发表于 2003-11-17 01:52:59 | 显示全部楼层
脑筋急转弯儿 ? 你这是手筋直转弯儿 ,哈哈,多谢google
 楼主| 发表于 2003-11-17 23:57:57 | 显示全部楼层
upon, 你既然耍小聪明,那就给大家讲讲为什么cd 必是built-in fonction, 而不可以是system call 吧。 javalee和hmqq的答案在我眼里最正确,其他功能是跟不同的shell 变化或多或少。。。
发表于 2003-11-18 00:43:24 | 显示全部楼层
一般来说~~,当你无法判断一个命令是shell内置命令或者系统命令的时候,type可以帮助你!
比如:
$type cd
cd is a shell builtin
$type touch
touch is /bin/touch
比较有趣的是echo,他是个双重身份的命令,
$whereis echo
echo: /bin/echo /usr/share/man/man1/echo.1.gz
$type echo
echo is a shell builtin
$type /bin/echo
/bin/echo is /bin/echo

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表