Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Awk- catching the last two chars Post 90297 by Corrail on Monday 21st of November 2005 11:56:05 AM
Old 11-21-2005
Another suggestion if the otherone doesnt work

sed -n '/STRING/,$p' filename|head -$n
Thats what i found while floating around on the forums now maybe you could change head to foot and possible make it so instead of the line and 2 more lines print, change it to make the last 2 character print? Idk maybe this will help you realize what you need or something? But can someone let me know whats wrong with this if it doesnt work maybe?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to convert C source from 8bit chars to 16bit chars?

I was using the following bash command inside the emacs compile command to search C++ source code: grep -inr --include='*.h' --include='*.cpp' '"' * | sed "/include/d" | sed "/_T/d" | sed '/^ *\/\//d' | sed '/extern/d' Emacs will then position me in the correct file and at the correct line... (0 Replies)
Discussion started by: siegfried
0 Replies

2. Shell Programming and Scripting

Removing " " chars using Awk

HI Friends, I am trying to elliminate the " " characters from the word: "hello" using awk. I need the output to be just = hello (without " " chars). Is there any way to do this ? Thanks! (3 Replies)
Discussion started by: vijaya2006
3 Replies

3. Shell Programming and Scripting

find 4 chars on 2nd line, 44 chars over

I know this should be simple, but I've been manning sed awk grep and find and am stupidly stumped :( I'm trying to use sed (or awk, find, etc) to find 4 characters on the second line of a file.txt 44-47 characters in. I can find lots of sed things for lines, but not characters. (4 Replies)
Discussion started by: unclecameron
4 Replies

4. Programming

Signal catching

Hi! I want to catch all signals that my program receives print their name and then execute the default handler. Can you help me on that? I've tried the following code: #include <stdio.h> #include <unistd.h> #include <signal.h> void (*hnd)(int i); char signals = { "SIGHUP",... (7 Replies)
Discussion started by: dark_knight
7 Replies

5. Shell Programming and Scripting

Catching errors

Hi, I'm writing a scheduling script which will co-ordinate the launching of scripts. This script is scheduling based on an input file, and launches the appropriate scripts at the right times. The only issue I'm having is: - if a script dies, or even has a syntax error, I want to catch... (1 Reply)
Discussion started by: GoldenEye4ever
1 Replies

6. Shell Programming and Scripting

awk to print count for chars recurrence

input: 123456 1111 124567 2222 125678 3333 234567 aaaa 456789 abcd awk logic: - read lines for recurring 1st 2 chars of the 1st field - if recurrence detected count up and print value output: 1 123456 1111 2 124567 2222 3 125678 3333 (6 Replies)
Discussion started by: ux4me
6 Replies

7. Shell Programming and Scripting

AWK/SED: handle max chars in a line

Hi all, I hope you guys can help me. I prefer SED/AWK solutions if possible. For my shame it didn't work for me :o ISSUE: :wall: 1\3 1/$4\@7\ 1234567890123456789\ 1234567890123456789,\ 1234567890123456789\ 123456789012 12345 1234567890123456789\ 1234567890123456789,\ 1234... (5 Replies)
Discussion started by: unknown7
5 Replies

8. Shell Programming and Scripting

AWK splitting a string of equal parts of 500 chars

Hi , can someone help me how to make an AWK code for splitting a string of equal parts of 500 chars in while loop? Thank you! (4 Replies)
Discussion started by: sanantonio7777
4 Replies

9. UNIX for Beginners Questions & Answers

Shell script to split data with a delimiter having chars and special chars

Hi Team, I have a file a1.txt with data as follows. dfjakjf...asdfkasj</EnableQuotedIDs><SQL><SelectStatement modified='1' type='string'><! The delimiter string: <SelectStatement modified='1' type='string'><! dlm="<SelectStatement modified='1' type='string'><! The above command is... (7 Replies)
Discussion started by: kmanivan82
7 Replies
ESCPUTIL(1)						      Gutenprint Manual Pages						       ESCPUTIL(1)

NAME
escputil - maintain Epson Stylus inkjet printers SYNOPSIS
escputil [ -P printer | -r device ] [ -m model ] [ -u ] [ -c | -n | -a | -i | -d | -o | -s | -l | -M | -h ] [ -q ] DESCRIPTION
escputil is a command line utility to perform various maintenance tasks on Epson Stylus inkjet printers. These tasks include head align- ment, head cleaning, nozzle check, printer identification, and retrieval of ink level from the printer. OPTIONS
escputil accepts the following options: -P, --printer-name=printer Specify the name of the printer to operate on. The default is the default system printer. -r, --raw-device=device Specify the name of the device to write to directly rather than going through a printer queue. You must use this (rather than speci- fying a printer) when retrieving ink levels or identifying the printer, or if you wish to perform head alignment without specifying the printer model. -m, --model=model Specify the precise printer model for head alignment. -u, --new The printer is a new printer (Stylus Color 740 or newer). -c, --clean-head Clean the print head. This can also be performed from the printer front panel. -n, --nozzle-check Print a nozzle test pattern. Dirty or clogged nozzles will show as gaps in the pattern. If you see any gaps, you should run a head cleaning pass or two. -a, --align-head Align the print head. CAUTION: Misuse of this option may result in poor print quality and/or damage to the printer. You must either specify the printer model with the -m option, or use the raw printer device to allow escputil to detect the printer model. -i, --ink-level Obtain the ink level from the printer. This requires read/write access to the raw printer device. -d, --identify Query the printer for make and model information. This requires read/write access to the raw printer device. -o, --align-color Align the color print head (used by Stylus Color 480 and 580 only). CAUTION: Misuse of this option may result in poor print quality and/or damage to the printer. -s, --status Retrieve printer status. -l, --license Display the license/warranty terms of this program. -M, --list-models List the supported printer models. -h, --help Display a list of all command line options. -q, --quiet Suppress the banner. BUGS
USB-connected printers sometimes fail to identify or return ink levels. You may have to repeat the command. This is probably a timing issue in escputil, not a flaw in the printer. Anything requiring bidirectional communication with the printer (identify, ink levels, or head alignment without specifying the printer model) requires read/write access to the printer port (for example /dev/lp0). This may require these operations to be performed as root. In addition, kernel support is required for bidirectional communication. For Linux version 2.2, CONFIG_PRINTER_READBACK should be enabled; this is called CONFIG_PARPORT_1284 on 2.4 and later kernels. If the printer is performing self-test or head cleaning on power up, the identify and ink level commands will time out, although the printer successfully receives the command. The command will need to be reissued when the printer is quiescent. AUTHORS
Robert Krawitz. COPYRIGHT
Copyright (C) 2000 Robert Krawitz (rlk@alum.mit.edu) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. OTHER INFORMATION
The homepage of the Gutenprint project from which this utility was contributed is located at http://gimp-print.sourceforge.net/. SEE ALSO
lp(4), tunelp(8). Version 5.2.3 21 Dec 2008 ESCPUTIL(1)
All times are GMT -4. The time now is 09:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy