⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 conf.rc

📁 这是一个同样来自贝尔实验室的和UNIX有着渊源的操作系统, 其简洁的设计和实现易于我们学习和理解
💻 RC
字号:
#!/bin/rc# the fossil configuration is stored at the 127kB offset in the disk# and extends for at most 1 kB.rfork efn usage {	echo 'usage: fossil/conf [-w] /dev/sdC0/fossil [config]' >[1=2]	exit usage}wflag=nowhile(! ~ $#* 0 && ~ $1 -* && ! ~ $1 --){	switch($1){	case -w		wflag=yes	case *		usage	}	shift}if(~ $1 --)	shiftif(~ $wflag no && ! ~ $#* 1)	usageif(~ $wflag yes && ! ~ $#* 1 2)	usagedisk=$1if(! test -f $disk){	echo 'unknown disk' $1 >[1=2]	exit nodisk}fn sigexit {	rm -f /tmp/fossilconf.$pid}if(~ $wflag yes){	{echo fossil config; cat $2} >/tmp/fossilconf.$pid || exit oops	if(! test -s /tmp/fossilconf.$pid){		echo 'config is empty; will not install' >[1=2]		exit emptyconfig	}	if(test `{ls -l /tmp/fossilconf.$pid | awk '{print $6}'} -gt 1024){		echo 'config is too long; max is a little less than a kilobyte' >[1=2]		exit toolong	}	dd -quiet 1 -bs 1024 -count 1 -if $disk -iseek 127 \		>/tmp/_fossilconf.old || exit backup	dd -quiet 1 -count 2 </dev/zero >>/tmp/fossilconf.$pid || exit dd	dd -quiet 1 -bs 1024 -count 1 -if /tmp/fossilconf.$pid \		-trunc 0 -of $disk -oseek 127 || exit dd2	exit 0}dd -quiet 1 -bs 1024 -count 1 -if $disk -iseek 127 |	aux/zerotrunc >/tmp/fossilconf.$pidif(! cmp -s <{sed 1q /tmp/fossilconf.$pid} <{echo fossil config}){	echo 'config has bad header' >[1=2]	exit badconfig}sed 1d /tmp/fossilconf.$pidexit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -