I'm trying to convert the following code from a Batch file to a Shell script. I'm having a hard time of it, it feel so much more complicated than putting together a batch file.
Any help would be appreciate:
code below:
@echo off
echo %PATH%
@for /f "delims=[] tokens=2" %%a in ('ping -n 1 google.com') do (
set "Google_IP=%%a"
)
pause
@for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %ComputerName% ^|
findstr [') do (
set "MY_IP=%%a"
)
)
echo Google IP : %Google_IP%
netstat -a
tracert google.com
echo IP of Current Computer : %MY_IP%
pause>nul & exit