Skip to main content
Skrip cengkerang untuk memudahkan tambah user

Katakan anda ingin menambah user di dalsam sesuatu machine, dan kerana jumlah pengguna yang ramai, dan anda ingin mudahkan kerja anda, apa kata cuba guna skrip yang saya tulis ni. Ada pelbagai cara, tapi yang ni works for me ! :-)

Ini isi userlist.txt

s0218495
s0234215
s0112914
s0138186
s0314940
s0211621
s0137852
s0135854
s0312774
s0223259
s0135673
s0220908
s0211216

dan seterusnya....

for i in `cat userlist.txt`;
do useradd -g 102 -d /export/home/$i -s /bin/sh -m $i;
done

siap!

:-)


cuba check /etc/passwd anda.

(cara ini saya gunakan di atas machine Sun, jadi by default untuk local user dia allocate pada /export/home )

Comments

Popular posts from this blog

Gue dengan S2 gue. Sronok banget!
Danga Bay, Chevrolet Optra and bio...(eh?) I thought it was Debian(haha). My colleague point me to the AirAsia flight turbin and he told me, "Macam debian punya logo" I saw a spiral on top the turbin blades. Pretty much like Debian Logo That's spark me to shoot for a pix. And I was warned by the airport staff. Uh,uh. Flash lamp will spark burst,eh? I was presented my "mock" research proposal. Suggested "Profiling Bioinformatics Application Behavior on Distributed Computing Architecture". Eh, will this gonna be bioinformatics specific or hardware optimization specific.or? Flashback: I spent almost a week at the office. When it's Subh azan,went back to my house for bath and pray. Reading all the journals and papers was not funny,really. Tough eye balls. No world cup. Ewh. And have some VCD lure. Uh,uh. you gonna be kidding. Anyway, I learned a lot and UTM SLAB Research Course is no joke. Really. My proposal has been corrected with comments so I have