Quantcast
Channel: Unix Scripting – wikiconsole
Viewing all articles
Browse latest Browse all 10

Unix Shell Scripts – Example 3

$
0
0

Write a shell script that takes a file where each line is given in the format:

 F08, Venkat, Suman, Karthy, SCS, CSD, 3, L, 4, 15123 , V ,,

Creates a folder for each user name (eg: Venkat) and set the permission to rw access for user only (hint: use fs sa)

Ans:

#! /bin/sh

cat $1 |
while read line
do
     userid=echo $line | cut –d”,” –f2 
     mkdir $userid
     fs sa $userid $userid rw
done


Viewing all articles
Browse latest Browse all 10

Trending Articles