Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Making Emacs to show line number Post 46881 by saurya_s on Wednesday 28th of January 2004 12:11:53 PM
Old 01-28-2004
Hi
Quite simple thing I guess I am asking. Emacs is thought to be one of the most powerful editors!! So is there any other way of acheiving this kind of thing. I normally use BBEdit on OSX and jump to a line comes very handy, so I thought i might extend that to UNIX as well - will be useful whe I am not on xterm.
SS
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

emacs as a line editor

hello, I would like to use emacs as a line editor (I use emacs as editor). I try "set -o emacs" but I have nothing. Thank you for any help (5 Replies)
Discussion started by: annemar
5 Replies

2. Shell Programming and Scripting

making sure a command line paramter is a number

i need to make sure that a command line paramter is with in a certin set of numbers and i dont know how todo it with out checking individual numbers. if test $1 -eq (need something here) then echo hi fi like if i put individual numbers in there it works fine but how do i do a range (3 Replies)
Discussion started by: rcunn87
3 Replies

3. Shell Programming and Scripting

Show result only if number is greater then

Hello all Im trying to write one liner that will show me results only if the result of the expression is greater then 0 For example: I do : find . -name "*.dsp" | xargs grep -c SecurityHandler the result are : ./foo/blah/a.dsp:0 ./foo/blah1/b.dsp:1 ./foo/blah2/c.dsp:2... (1 Reply)
Discussion started by: umen
1 Replies

4. Programming

Emacs line indentation

Hi. I'm writing a document in Python, so indentation is crucial. I want to indent a whole section by exactly one tab. Any idea how to go about this? I'm using terminal emacs (no mouse input) Thanks for any help! (2 Replies)
Discussion started by: Rledley
2 Replies

5. Shell Programming and Scripting

Making script show command (e.g. copy) being executed and variable substitution?

When script is running you only see when some of the commands are not successfull. Is there a way to see which command are executed and to show the substitution of variables as every line is executed ? (3 Replies)
Discussion started by: gr0124
3 Replies

6. UNIX for Dummies Questions & Answers

How to read contents of a file from a given line number upto line number again specified by user

Hello Everyone. I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below: if ; then if ; then tail +$1 $3 | head -n $2 else ... (5 Replies)
Discussion started by: grc
5 Replies

7. Shell Programming and Scripting

How to use command tail -f & show line number.

Hello Guys, I have created function which is as follow: tail -f filename |grep "Key word" output from this command 19-11-2011 21:09:15,234 - INFO Numbement - error number:result = :11 19-11-2011 21:09:15,286 - INFO Numbement - error number:result = :11 19-11-2011 21:09:15,523 - INFO... (5 Replies)
Discussion started by: ooilinlove
5 Replies

8. UNIX for Dummies Questions & Answers

How to use emacs? Also how to open existing emacs files with .cgi format?

Hi All, I am new to this forum and a beginner in unix. Please correct me if I put the question in a wrong way.. How to use emacs editor? Also how to open existing emacs files with .cgi format? I have the following link :- http link i.e. url and path : /abc/xyz.dev/xyz/documents What... (7 Replies)
Discussion started by: swathi123
7 Replies

9. Shell Programming and Scripting

Show difference between two number

Hi, I would like to show the difference between two numbers. For example. input.txt 1 7 2 10 0 0 6 7 I would like a third field showing the difference between the numbers as below: ouput.txt 1 7 6 2 10 8 0 0 0 6 7 1 How do I do this? (4 Replies)
Discussion started by: general_lee
4 Replies
Data::OptList(3)					User Contributed Perl Documentation					  Data::OptList(3)

NAME
Data::OptList - parse and validate simple name/value option pairs VERSION
version 0.109 SYNOPSIS
use Data::OptList; my $options = Data::OptList::mkopt([ qw(key1 key2 key3 key4), key5 => { ... }, key6 => [ ... ], key7 => sub { ... }, key8 => { ... }, key8 => [ ... ], ]); ...is the same thing, more or less, as: my $options = [ [ key1 => undef, ], [ key2 => undef, ], [ key3 => undef, ], [ key4 => undef, ], [ key5 => { ... }, ], [ key6 => [ ... ], ], [ key7 => sub { ... }, ], [ key8 => { ... }, ], [ key8 => [ ... ], ], ]); DESCRIPTION
Hashes are great for storing named data, but if you want more than one entry for a name, you have to use a list of pairs. Even then, this is really boring to write: $values = [ foo => undef, bar => undef, baz => undef, xyz => { ... }, ]; Just look at all those undefs! Don't worry, we can get rid of those: $values = [ map { $_ => undef } qw(foo bar baz), xyz => { ... }, ]; Aaaauuugh! We've saved a little typing, but now it requires thought to read, and thinking is even worse than typing... and it's got a bug! It looked right, didn't it? Well, the "xyz => { ... }" gets consumed by the map, and we don't get the data we wanted. With Data::OptList, you can do this instead: $values = Data::OptList::mkopt([ qw(foo bar baz), xyz => { ... }, ]); This works by assuming that any defined scalar is a name and any reference following a name is its value. FUNCTIONS
mkopt my $opt_list = Data::OptList::mkopt($input, \%arg); Valid arguments are: moniker - a word used in errors to describe the opt list; encouraged require_unique - if true, no name may appear more than once must_be - types to which opt list values are limited (described below) name_test - a coderef used to test whether a value can be a name (described below, but you probably don't want this) This produces an array of arrays; the inner arrays are name/value pairs. Values will be either "undef" or a reference. Positional parameters may be used for compatibility with the old "mkopt" interface: my $opt_list = Data::OptList::mkopt($input, $moniker, $req_uni, $must_be); Valid values for $input: undef -> [] hashref -> [ [ key1 => value1 ] ... ] # non-ref values become undef arrayref -> every name followed by a non-name becomes a pair: [ name => ref ] every name followed by undef becomes a pair: [ name => undef ] otherwise, it becomes [ name => undef ] like so: [ "a", "b", [ 1, 2 ] ] -> [ [ a => undef ], [ b => [ 1, 2 ] ] ] By default, a name is any defined non-reference. The "name_test" parameter can be a code ref that tests whether the argument passed it is a name or not. This should be used rarely. Interactions between "require_unique" and "name_test" are not yet particularly elegant, as "require_unique" just tests string equality. This may change. The "must_be" parameter is either a scalar or array of scalars; it defines what kind(s) of refs may be values. If an invalid value is found, an exception is thrown. If no value is passed for this argument, any reference is valid. If "must_be" specifies that values must be CODE, HASH, ARRAY, or SCALAR, then Params::Util is used to check whether the given value can provide that interface. Otherwise, it checks that the given value is an object of the kind. In other words: [ qw(SCALAR HASH Object::Known) ] Means: _SCALAR0($value) or _HASH($value) or _INSTANCE($value, 'Object::Known') mkopt_hash my $opt_hash = Data::OptList::mkopt_hash($input, $moniker, $must_be); Given valid "mkopt" input, this routine returns a reference to a hash. It will throw an exception if any name has more than one value. EXPORTS
Both "mkopt" and "mkopt_hash" may be exported on request. AUTHOR
Ricardo Signes <rjbs@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2006 by Ricardo Signes. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.18.2 2013-12-13 Data::OptList(3)
All times are GMT -4. The time now is 11:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy