Search Results

Search: Posts Made By: BzGuy
23,383
Posted By BzGuy
telnet / port check in a script
#!/bin/ksh
LIST="apple:22
oracle:23
kiwi:9999
pear:21"
FILE="/tmp/telnet_port_status"
cat /dev/null >${FILE}
for HST in ${LIST};do
HOST=$(echo ${HST}|awk -F: '{print $1}')
PORT=$(echo...
3,502
Posted By BzGuy
use ed in a for loop
try this..
for i in $(ls);do
(echo "1,$ s:^:${i}<insert a tab>:g";echo "w";echo "q") | ed -s ${i}
done

this will open each file in the current dir, then from top to bottom of the file insert ...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 10:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy