脑筋急转弯儿 - 再请大家试一试
时间:2003-11-17
来源:互联网
活跃一下坛子的气氛,对UNIX一些基础的基础有一定的了解。看完了题,回机器上
一试就有结果。知道结果后,最好想想为什么,那我们的目的就达到了。
这回再给大家出个小题目,条件和上回一样,另外请大家看完题目先做题,后看其
它人的帖子:
在shell 工作情况下,请给举个“command"的例子,这个command是一个shell 的"built
in fonction", 而不是一个”system call"。
a. 看完之后张口就出的,得满分(当然要对了)
b. 1分钟内给正确答案的得80分
c. 10分钟内给正确答案的得60分
d. 不知我在说什么的,不及格啦。。。
作者: werix 发布时间: 2003-11-17
作者: KornLee 发布时间: 2003-11-17
作者: hmqq 发布时间: 2003-11-17
bash
export
作者: hmqq 发布时间: 2003-11-17
作者: home 发布时间: 2003-11-17
作者: werix 发布时间: 2003-11-17
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
作者: upon 发布时间: 2003-11-17
作者: werix 发布时间: 2003-11-17
作者: werix 发布时间: 2003-11-18
比如:
$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
作者: KornLee 发布时间: 2003-11-18
作者: bouzouki 发布时间: 2003-11-18
问题问到点子上了,这也正是这个题的原意: 什么是built-in fonction? 什么是
system call?
简单的说shell 本身就是一个程序/进程,它还是一个用户跟系统之间的一个界面,
用户通过这个界面输入指令,每一个指令都是由shell 做一个fork,产生新的子进
程,在新的子进程里 执行一下execl, execlp, execle, execv, execvp,所有用execl的都是system call。还有是shell里自己的命令,这些命令不需要用execl,这就是我们所说的shell built-in fonction。 为什么cd 必是 built-in fonction呢?请看man cd (我在最后列出来了)
system call
BSD:
man -s 2 intro
linux:
man -S 2 intro
man fork
man cd
DESCRIPTION
directory is an absolute or relative pathname which becomes the new work-ing directory. The interpretation of a relative pathname by cd depends on the CDPATH environment variable (see below).
Note that cd is implemented as a built-in shell command and not as a stand-alone program. Because each process has its own working directory,
a separate cd utility would have no effect (it would change the directory and exit, leaving the working directory in the parent unchanged). Different shells may implement cd with features different from those described here. Please consult the manual for your specific shell.
作者: werix 发布时间: 2003-11-18
作者: bouzouki 发布时间: 2003-11-19
作者: qing 发布时间: 2003-11-19
作者: upon 发布时间: 2003-11-21
作者: werix 发布时间: 2003-11-21
你那个无痛安装贴子中的KDE包是哪里搞来的?OpenBSD光盘中并无此包啊。
作者: upon 发布时间: 2003-11-22
As shown: we can easy install them with pkg_add kde*
Hope this can help you.
作者: werix 发布时间: 2003-11-22
I'm downloaging the kde packages from openbsd official sites now.
but which mirror site is the nearest one in our country?
Thank U.
作者: upon 发布时间: 2003-11-22
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28