Documente Academic
Documente Profesional
Documente Cultură
C php
For x in list
do
lnh
done
V d:
[root@localhost ~]# for i in ktoan kdoanh dtao; do mkdir $i; done
[root@localhost ~]# ll
total 116
-rw-------. 1 root root 1585 Jul 6 2012 anaconda-ks.cfg
drwxr-xr-x. 2 root root 4096 Aug 31 18:29 Desktop
drwxr-xr-x. 2 root root 4096 Jul 6 2012 Documents
drwxr-xr-x. 2 root root 4096 Jul 6 2012 Downloads
drwxr-xr-x 2 root root 4096 Oct 8 17:46 dtao
-rw-r--r--. 1 root root 47875 Jul 6 2012 install.log
-rw-r--r--. 1 root root 10837 Jul 6 2012 install.log.syslog
drwxr-xr-x 2 root root 4096 Oct 8 17:46 kdoanh
drwxr-xr-x 2 root root 4096 Oct 8 17:46 ktoan
drwxr-xr-x. 2 root root 4096 Jul 6 2012 Music
drwxr-xr-x. 2 root root 4096 Jul 6 2012 Pictures
lyhoanghai
vohoangtam
[root@localhost VongLapFor]# vi taouser
clear
echo " T A O U S E R"
read -p "Nhap file chua user: " file
for i in `cat $file`
do
useradd $i
echo 123 | passwd --stdin $i > /dev/null
echo -n "+ "
done
echo End
[root@localhost VongLapFor]# bash taouser
TAO USER
Nhap file chua user: danhsach.txt
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++
End
[root@localhost VongLapFor]# cat /etc/passwd
lyhoanghai:x:506:506::/home/lyhoanghai:/bin/bash
vohoangtam:x:507:507::/home/vohoangtam:/bin/bash
nguyenducthinh:x:508:508::/home/nguyenducthinh:/bin/bash
phamcaohai:x:509:509::/home/phamcaohai:/bin/bash
maiphuctien:x:510:510::/home/maiphuctien:/bin/bash
nguyenmanhtuan:x:511:511::/home/nguyenmanhtuan:/bin/bash
huynhtanvinh:x:512:512::/home/huynhtanvinh:/bin/bash
hoangthanhtrung:x:513:513::/home/hoangthanhtrung:/bin/bash
phanlongyenanh:x:514:514::/home/phanlongyenanh:/bin/bash
duongthienduc:x:515:515::/home/duongthienduc:/bin/bash
dangquochung:x:516:516::/home/dangquochung:/bin/bash
truongnghiaan:x:517:517::/home/truongnghiaan:/bin/bash
nguyenhoangdam:x:518:518::/home/nguyenhoangdam:/bin/bash