LinuxSir.cn,穿越时空的Linuxsir!

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

一周一练。

[复制链接]
发表于 2004-3-29 11:02:50 | 显示全部楼层 |阅读模式
Description

Your shell script must output the following information in a readable format:

~ the absolute path to the current directory
~ who you are (your login id)
~ the number of visible files in the current directory and a sorted list of them in a 3-column format
~ the number of visible directories in the current directory and a sorted list of them in a three-column format.

As with ecery shell script, document the beginning of your shell script so that a Unix novice could understand what it does and how to run it.

To Turn In
The name of your program must be INFO . it must be a bash sheel script
Turn in a papter copy of you shell script and a standard script session.

showing it working on the following test cases:
~when connected to your home directory
~when connected to the directory /etc
~when connected to the directory /pub/cs/gboyd/cs160b/samples
发表于 2004-3-31 13:19:05 | 显示全部楼层
what's the meaning of this?
could you translate it into chinese?
 楼主| 发表于 2004-4-2 13:20:10 | 显示全部楼层
bash-2.04$ cat asmt01
#!/bin/bash
#******************************  Asmt 01    kevin yang  ,zhuoping li
#
#
#
#
echo -e '########################################################\n'

echo '*** The current directory'
pwd



echo '-------------------------------------------------------'

echo -e '*** The number of visible file in the current directory:\c'
ls -l |grep '^-.*'|wc -l

echo 'Below is a list of these files:'
ls -l |grep '^-.*'|cut -c59-| pr -t -3-


echo '--------------------------------------------------------'

echo -e '*** The number of visible directories in the current directory:\c'
ls -l |grep '^d.*' |wc -l

echo 'Below is a list of these files:'
ls -l |grep '^d.*'|cut -c59-|pr -t -3-
echo '##############################################


运行在:
~your home directory
~ the directory /etc
~the directory /pub/cs/gboyd/cs160b/samples
发表于 2004-4-5 14:02:45 | 显示全部楼层
I see, thank you every much!
发表于 2004-4-5 14:17:13 | 显示全部楼层
I see, thank you every much!
 楼主| 发表于 2004-4-7 09:55:21 | 显示全部楼层
不客气
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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