LinuxSir.cn,穿越时空的Linuxsir!

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

帮忙看一个mount的脚本

[复制链接]
发表于 2004-6-18 14:29:55 | 显示全部楼层 |阅读模式
这是一个mount分区的脚本,我想让它加上-o iocharset=gb2312的参数,请问怎么改??我还没有学习编写脚本

#!/bin/bash
# Started as a daemon only if "daemon" parameter is present as $1
# Will analyze /dev/discs each second and if new disc is found then it's
# mounted to /mnt/...
#
# example of usage: mntall        # will mount all discs and exit
# example of usage: mntall daemon # will try to mount all discs each second
#
# Author: Tomas Matejicek <http://slax.linux-live.org>
#
# Note:   I believe that there is a better way how to mount new discs
#         automatically, but to be honest I'm very lazy to learn it.
#         It works great this way with devfs.
#

DDIR=/dev/discs
if [ ! -d $DDIR ]; then exit; fi
ls -aAb1 $DDIR | while read DISC ; # list all files in directory
do
   ls -aAb1 "$DDIR/$DISC" | grep part | while read PART;
   do
      MYMOUNT="/mnt/$DISC$PART"
      if [ ! -d "$MYMOUNT" ]; then
         mkdir -p "$MYMOUNT"
         mount -t auto "$DDIR/$DISC/$PART" "$MYMOUNT" >/dev/null 2>/dev/null
         if [ "$?" != 0 ]; then rmdir "$MYMOUNT"; fi
      fi
   done
:
发表于 2004-6-18 15:56:22 | 显示全部楼层
man mount
发表于 2004-6-22 15:31:11 | 显示全部楼层
mount -t auto -o iocharset=gb2312 "$DDIR/$DISC/$PART" "$MYMOUNT" 1> /dev/null 2>&1
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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