OpenVZ Forum


Home » General » Support » OpenVZ and Debian
Re: OpenVZ and Debian [message #1422 is a reply to message #1416] Wed, 08 February 2006 08:41 Go to previous messageGo to previous message
phlar is currently offline  phlar
Messages: 2
Registered: February 2006
Junior Member
kir wrote on Wed, 08 February 2006 08:18

phlar,

The problem is if I execute the command you give on my Fedora Core 4 box, it will give me 'eth0:' i.e. with comma which should be stripped off. Looks like debian awk and fedora core awk do not agree on the syntax of substr.


Yes, i suspect that the debian-awk starts not at the index zero. The first position is 1 not 0. And it is possible to start at positions lower than zero. Confused

openvz:~# echo "test"|awk '{print substr($1,1,4)}'
test
openvz:~# echo "test"|awk '{print substr($1,0,4)}'
tes
openvz:~# echo "test"|awk '{print substr($1,-1,4)}'
te
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: filesystem: ext2 or ext3?
Next Topic: How does one add GCC to their VPS?
Goto Forum:
  


Current Time: Sat Aug 24 09:23:20 GMT 2024

Total time taken to generate the page: 0.03508 seconds