LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Any code I post here should be considered experimental and unfinished. Don't use it in a production environment. It is your own responsibility to evaluate the code's fitness for any purpose. Programming isn't done in a vacuum, so be prepared to do your own research and teach yourself to do better.

Most importantly, all your polite critiques, elaborations, and corrections are heartily welcomed.
Old

a reminder to myself

Posted 12-29-2011 at 08:17 PM by Telengard (Here are some things which I hope will be helpful.)
Updated 12-30-2011 at 05:20 PM by Telengard

Don't do this. srsly

http://www.linuxquestions.org/questi...7/#post4043661

Also see mod response.

http://www.linuxquestions.org/questi...3/#post4561593
Member
Posted in Uncategorized
Views 1308 Comments 0 Telengard is offline
Old

Selecting fields from a line using "sed"

Posted 12-25-2011 at 12:51 AM by Telengard (Here are some things which I hope will be helpful.)
Updated 12-26-2011 at 10:24 PM by Telengard
Tags sed

Yeah, sed ...

No matter how well I think I know sed, it still manages to bite me more often than serve me. Everything I do know about sed, manuals aside, I learned from other programs like ed, vi, and even awk. What I'm getting to is this: my sed-fu is weak, so don't take anything I say about it at face value. Do your own research and learn better for yourself (which you ought to do regardless).

About portability

I'll be using the --posix option with GNU sed...
Member
Views 18518 Comments 0 Telengard is offline
Old

Selecting fields from a line using "cut"

Posted 12-22-2011 at 06:56 PM by Telengard (Here are some things which I hope will be helpful.)
Updated 12-26-2011 at 10:26 PM by Telengard
Tags cut

using cut to break down text

You can use cut to grab only the data you want from a line of text. Tell cut which groups of characters you are interested in and it will print them. By default cut uses tab characters to break down groups of text from the input file.

NOTE: In the example data files which follow, the strings <TAB> and <SPACE> shall be used to visually distinguish whitespace characters. A tab character is the character generated when you press the...
Member
Views 13026 Comments 0 Telengard is offline
Old

How to kill lines before and after a pattern

Posted 12-21-2011 at 05:45 PM by Telengard (Here are some things which I hope will be helpful.)
Updated 12-21-2011 at 06:27 PM by Telengard
Tags awk

PHP Code:
#! /usr/bin/awk -f

# Deletes n lines before pattern and m lines after.
# Intended to be portable.
# It is your own responsibility to evaluate the fitness of this program.

BEGIN {
    
# set the following initializers as you please
    # FS=" "
    # OFS=" "
    
n=5
    m
=3
}

/
line 11/ { # insert your desired regex "pattern" between the slashes
    
pattern_line=FNR 
...
Member
Posted in programming
Views 1535 Comments 0 Telengard is offline
Old

How to install Rogue in Ubuntu

Posted 12-19-2011 at 12:12 PM by Telengard (Here are some things which I hope will be helpful.)

Rogue is in the bsdgames-nonfree package. Ensure the multiverse repository is enabled and install the bsdgames-nonfree package in your package manager.

Code:
sudo apt-get install bsdgames-nonfree
References
Member
Posted in newbie faqs
Views 13943 Comments 0 Telengard is offline

  



All times are GMT -5. The time now is 07:51 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration