Changeset 32463
- Timestamp:
- 2018-09-17T17:46:52+12:00 (6 years ago)
- Location:
- main/trunk/greenstone3/bin/script
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/bin/script/IPv4.bat
r31107 r32463 39 39 ::set result=^|%result% 40 40 41 :: Echo a vertical bar up front, regardless of whether the result is empty 41 42 echo ^|%result% 42 43 goto fin … … 44 45 45 46 :done 46 :: Echo a vertical bar up front, regardless of whether the result is empty47 47 echo %result% 48 48 -
main/trunk/greenstone3/bin/script/IPv4.sh
r30038 r32463 13 13 # But need to still replace the . with \. 14 14 15 #echo `ifconfig | grep "inet " | grep -v 127.0.0.1`|cut -d' ' -f 2|cut -d':' -f 215 #echo `ifconfig eth0 | grep "inet " | grep -v 127.0.0.1`|cut -d' ' -f 2|cut -d':' -f 2 16 16 17 tmp=`ifconfig | grep "inet " | grep -v 127.0.0.1` 17 tmp=`ifconfig eth0 2>&1 | grep "inet " | grep -v 127.0.0.1` 18 # As below: if $tmp is empty, can just return |, as that doesn't really matter. Will be consistent with windows 19 if [[ $tmp = *"Device not found"* ]] || [[ -z "${tmp// }" ]]; then 20 echo "|" 21 fi 18 22 23 # grab just the portion of the line we want 19 24 tmp=`echo $tmp|cut -d' ' -f 2|cut -d':' -f 2` 20 25
Note:
See TracChangeset
for help on using the changeset viewer.