Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Trying to create a process for work to make things simple.
> /tmp/clients.txt
> /tmp/scpcom.txt
serverip=`hostname -i | cut -f1-3 -d'.'`
findsmb | grep $serverip | grep CLIENT | cut -f1 -d' ' | cut -f4 -d'.' > /tmp/clients.txt
for client in `cat /tmp/clients.txt` ; do
echo "$serverip.$client $client" >> /tmp/scpcom.txt
donefor clients in `cat /tmp/scpcom.txt` ;
do echo $clients < ------------
doneMy problem is the above command, the text file echo's out like this;
xx.xx.7.13 13
1x.xx.7.14 14
1x.xx.7.15 15
1x.xx.7.16 16
1x.xx.7.80 80
1x.xx.7.81 81i then want to parse this line to an expect script as 2 variables. so for example
echo $clientip $clientnum
hoping it will output 1x.xx.7.81 81Can somebody help with this please?

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |