forked from vilasvarghese/devops
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathifs.sh
More file actions
48 lines (39 loc) · 735 Bytes
/
Copy pathifs.sh
File metadata and controls
48 lines (39 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
#Purpose: Internal Field Seperator
#Version:1.0
#Created Date: Wed Jun 13 21:58:18 IST 2018
#Modified Date:
#WebSite: WIP
#Author: Vilas Varghese
# START #
#!/bin/bash
string="foo bar foobar"
for i in $string
do
echo "'$i' is the substring"
done
#space is one of the IFS
string="foo\tbar\tfoobar"
for i in $string
do
echo "'$i' is the substring"
done
old_ifs="$IFS"
IFS="\t"
for i in $string
do
echo "'$i' is the substring"
done
LINE=`cat /etc/passwd |grep $1`
echo "$LINE"
IFS=:
set $LINE
echo "User Name = $1"
echo "Password = $2"
echo "UID = $3"
echo "GID = $4"
echo "Description = $5"
echo "Home Directory = $6 "
echo " Current Shell = $7"
# execution: filename user - e.g. sh ifs.sh vagrant
# END #