04-28-2009
head followed by variable??
I know that the common use of head is for example head -3 etc.Is there any possibility that,if i have a variable that equals to an integer(i=5),i can write head -i??
If not,what syntax or commands should i write down in order to have the same result?
//maybe something lik head -"$variable" ?
Last edited by bashuser2; 04-28-2009 at 08:05 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
my boss has done it again
I have been sent to fix a unix issue
and I ma hoping you can help
three issues
1st. I have a printer that when you try to print to it the print job comes out on a diffrent printer. If I take the printer ( dot matrix thourgh a serail connection) to a diffrent local the... (3 Replies)
Discussion started by: oberon42
3 Replies
2. Shell Programming and Scripting
Hi All,
How can the head command be used to extract only a particular line.
By default head -n filename displays the first n lines. I want only the nth line.
I couldn't get it from forum search.
Thanks,
Sumesh (6 Replies)
Discussion started by: sumesh.abraham
6 Replies
3. Programming
I have written a c socket programe which can send the http GET request.But it dont work for HEAD reuest.can anyone help me.I am connected to internet via a proxy and the port/ip in the programe are proxies ones
--------------------------------------------------
#include <stdlib.h>
#include... (3 Replies)
Discussion started by: chamaraHe
3 Replies
4. Shell Programming and Scripting
$ct=1
head -n $ct file.
When i used like this, i got an error , Bad usage of head
Cant we use variables in place of number in HEAD.
In my requirement for every iteration i should increase the number in Head and tail the last one.
HOw can i achieve this (5 Replies)
Discussion started by: vasuarjula
5 Replies
5. Shell Programming and Scripting
I have a file with a single filename in it, which I want to assign to a BASH variable, so I've been trying:
c=$(head -1 somefile)
echo $c
which outputs correctly, but them when I do
...
somecommand $c
it says it can't find the file, is that because it's grabbing the whole line, and... (5 Replies)
Discussion started by: unclecameron
5 Replies
6. Shell Programming and Scripting
Hi, I have the following problem. I have files with one column of data (let's say file1.dat, file2.dat...file6.dat), and I would like to record the first value of the column of each file into another file (let's name it fileall.dat), which would have the the six values, one in each column. I use to... (4 Replies)
Discussion started by: josegr
4 Replies
7. OS X (Apple)
I am trying to run a csh script (this is usually done on my Linux machine but it died, so I had to resort to a Mac :eek:) and I received the following error message:
head: illegal option --q
My script takes multiple files as the input, concatenates them and produces a single file as the... (4 Replies)
Discussion started by: mac_novice
4 Replies
8. UNIX for Dummies Questions & Answers
i have lots of files in /law/prod and /law/dev, such as AP20PD, AP20WS, AP20.scr, AP20.rpt
if i am in /law DIR
find . -name AP20PD, found in /law/prod and /law/dev
i want to head -1 AP20PD from both location and >> /tmp/test.log
can i use find and head in one line ?
----------... (1 Reply)
Discussion started by: tjmannonline
1 Replies
9. UNIX for Dummies Questions & Answers
Hi all,
I have a list of text, single column and I want to print the first 20, then the second 20 and so on. I was pointed to xarg to help with this, but can't get my head around how to use it.
Would be great if it would put them into separate files with a certain name.
Any suggestions... (2 Replies)
Discussion started by: onfirealot
2 Replies
10. Shell Programming and Scripting
Hello !
Pondering over some old post & I need some help.
Here is the link below -
https://www.unix.com/shell-programming-and-scripting/157909-pull-intermediate-strings.html
When I run this,
echo " process(130) Deleting Text on line 11 (ESN:27723211621B01DJ68AG) because a number... (2 Replies)
Discussion started by: OMLEELA
2 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)