Posts by Wlady Neto • 31 points
4 posts
- 
		0 votes1 answer86 viewsA: while read does not work in Unix shell scriptI found the problem, ssh uses stdin causing the problem of stopping the 1 loop after only 1 pass, when I use the -n option it redirects stdin stopping the problem. Problem source: ssh "$un@$line"… 
- 
		0 votes1 answer86 viewsQ: while read does not work in Unix shell scriptI’m writing a script and using while read twice he makes the 1 only once: un=$(echo $LOGNAME | tr '[A-Z]' '[a-z]') grep -v '^#' nodeteste.txt > auxiliar.txt while read line do ssh "$un@$line"… 
- 
		2 votes1 answer181 viewsA: Unix Command Grep output manipulation if no result is foundPeople I managed to solve this problem as follows! grep -v '^#' < arquivo.com.o.que.procuro | while read line2; do valor=$(grep -c "$line2 " arquivo.onde.estou.procurando) if [ $valor -eq 0 ];… 
- 
		1 votes1 answer181 viewsQ: Unix Command Grep output manipulation if no result is foundGood morning!! I am creating a script and I need that when I do a grep on a line and do not find it it return me the parameter I searched! grep "192.0.0.1 " /file.txt In the.txt file it does not…