Gérard ROBIN
2018-11-20 10:51:07 UTC
Hello,
I encounter a problem when I modify IFS with this file:
cat nomutilsuid.sh
#!/bin/bash
while read nom reste
do
svIFS=$IFS
IFS=:
set $nom
IFS=$svIFS
echo $1 $4
done < modfile
cat modfile
g:gg:ggg:1:bin
q:qq:qqq:2:bin
f:ff:fff:3:bin
k:*:kkk:4:bin
the output of ./nomutilsuid.sh
g 1
q 2
f 3
k danbin.sh
where danbin.sh is the third file of the current directory instead of 4.
The issue rises with the file /etc/passwd
How can we solve the problem ?
tia.
I encounter a problem when I modify IFS with this file:
cat nomutilsuid.sh
#!/bin/bash
while read nom reste
do
svIFS=$IFS
IFS=:
set $nom
IFS=$svIFS
echo $1 $4
done < modfile
cat modfile
g:gg:ggg:1:bin
q:qq:qqq:2:bin
f:ff:fff:3:bin
k:*:kkk:4:bin
the output of ./nomutilsuid.sh
g 1
q 2
f 3
k danbin.sh
where danbin.sh is the third file of the current directory instead of 4.
The issue rises with the file /etc/passwd
How can we solve the problem ?
tia.
--
Gerard
Gerard