Sponsored Content
Full Discussion: vi editor question
Top Forums UNIX for Dummies Questions & Answers vi editor question Post 302190418 by Dave Miller on Tuesday 29th of April 2008 04:04:00 PM
Old 04-29-2008
whoa!

I gotta write that one down!

Thanks.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

VI Editor question

When I use vi, I can type "set nu" in command mode to get line numbers. How can I get VI to start like that automatically? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

2. UNIX for Dummies Questions & Answers

Pasting text in VI editor from a different editor

Hi, I knw its a silly question, but am a newbie to 'vi' editor. I'm forced to use this, hence kindly help me with this question. How can i paste a chunk 'copied from' a different editor(gedit) in 'vi editor'? As i see, p & P options does work only within 'vi'. (10 Replies)
Discussion started by: harishmitty
10 Replies

3. Shell Programming and Scripting

set EDITOR=vi -> default editor not setting for cron tab

Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set... (6 Replies)
Discussion started by: aarora_98
6 Replies

4. Solaris

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :Licen

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :License server is down (1 Reply)
Discussion started by: durgaprasadr13
1 Replies

5. UNIX for Dummies Questions & Answers

vi editor question

Folks; I know this may sound stupid, but when i use vi to edit in SUSE, i see the file has a lot of underlines, how can i get rid of underline permanently so when i open any file to edit, i don't see any underlines? Thanks in advance (2 Replies)
Discussion started by: Katkota
2 Replies

6. BSD

FreeBSD Label Editor Post-install Question

Hello there, Over the past few days I have installed FreeBSD 7.1 (which i'm new at) to an external Hard Drive. When installing, I chose to partition the disk Automatically and now I'm trying to use the label editor (post-installation configuration) to name the mount points: / /usr... (2 Replies)
Discussion started by: septima.pars
2 Replies

7. Shell Programming and Scripting

VI Editor - question for unix gurus !!

I have created a dummy file -demo.txt On my machine-A (oslevel-5300-08) I can display the file content in HEX format through VI editor using :%!xxd but on other machine-B (oslevel - 5300-06) , I get error as "sh: xxd: not found." machine-A: $ cat demo.txt Hello World ! I can display... (7 Replies)
Discussion started by: Rahulpict
7 Replies

8. UNIX for Dummies Questions & Answers

vi editor question

This is an vi editor question. I do not know is this a right place to ask this question or not? I have a file with the following contents, 10 11 20 21 30 31 I want to copy first column that is 10,20,30 after second column, so that output will look like the following, 10 11 10 20 21... (1 Reply)
Discussion started by: MeetP
1 Replies

9. Post Here to Contact Site Administrators and Moderators

Message Editor question

Hia, this is a very low priority request, but I am slightly annoyed by the behaviour of the tags in the message editor. They behave assymetric in the sense that the opening tag is introducing an empty line, and the closing tag is not, and can't be convinced to do otherwise. I know I am... (1 Reply)
Discussion started by: Andre_Merzky
1 Replies

10. UNIX for Beginners Questions & Answers

Vi editor question

in Vi how do I delete part of a line ( leave few words in a line and delete rest of the line ) (6 Replies)
Discussion started by: pitagi
6 Replies
Net::netent(3pm)					 Perl Programmers Reference Guide					  Net::netent(3pm)

NAME
Net::netent - by-name interface to Perl's built-in getnet*() functions SYNOPSIS
use Net::netent qw(:FIELDS); getnetbyname("loopback") or die "bad net"; printf "%s is %08X ", $n_name, $n_net; use Net::netent; $n = getnetbyname("loopback") or die "bad net"; { # there's gotta be a better way, eh? @bytes = unpack("C4", pack("N", $n->net)); shift @bytes while @bytes && $bytes[0] == 0; } printf "%s is %08X [%d.%d.%d.%d] ", $n->name, $n->net, @bytes; DESCRIPTION
This module's default exports override the core getnetbyname() and getnetbyaddr() functions, replacing them with versions that return "Net::netent" objects. This object has methods that return the similarly named structure field name from the C's netent structure from netdb.h; namely name, aliases, addrtype, and net. The aliases method returns an array reference, the rest scalars. You may also import all the structure fields directly into your namespace as regular variables using the :FIELDS import tag. (Note that this still overrides your core functions.) Access these fields as variables named with a preceding "n_". Thus, "$net_obj->name()" corresponds to $n_name if you import the fields. Array references are available as regular array variables, so for example "@{ $net_obj->aliases() }" would be simply @n_aliases. The getnet() function is a simple front-end that forwards a numeric argument to getnetbyaddr(), and the rest to getnetbyname(). To access this functionality without the core overrides, pass the "use" an empty import list, and then access function functions with their full qualified names. On the other hand, the built-ins are still available via the "CORE::" pseudo-package. EXAMPLES
The getnet() functions do this in the Perl core: sv_setiv(sv, (I32)nent->n_net); The gethost() functions do this in the Perl core: sv_setpvn(sv, hent->h_addr, len); That means that the address comes back in binary for the host functions, and as a regular perl integer for the net ones. This seems a bug, but here's how to deal with it: use strict; use Socket; use Net::netent; @ARGV = ('loopback') unless @ARGV; my($n, $net); for $net ( @ARGV ) { unless ($n = getnetbyname($net)) { warn "$0: no such net: $net "; next; } printf " %s is %s%s ", $net, lc($n->name) eq lc($net) ? "" : "*really* ", $n->name; print " aliases are ", join(", ", @{$n->aliases}), " " if @{$n->aliases}; # this is stupid; first, why is this not in binary? # second, why am i going through these convolutions # to make it looks right { my @a = unpack("C4", pack("N", $n->net)); shift @a while @a && $a[0] == 0; printf " addr is %s [%d.%d.%d.%d] ", $n->net, @a; } if ($n = getnetbyaddr($n->net)) { if (lc($n->name) ne lc($net)) { printf " That addr reverses to net %s! ", $n->name; $net = $n->name; redo; } } } NOTE
While this class is currently implemented using the Class::Struct module to build a struct-like class, you shouldn't rely upon this. AUTHOR
Tom Christiansen perl v5.18.2 2013-11-04 Net::netent(3pm)
All times are GMT -4. The time now is 05:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy