Sponsored Content
Full Discussion: Printing a Line from a file
Top Forums UNIX for Dummies Questions & Answers Printing a Line from a file Post 302134357 by Nysif Steve on Thursday 30th of August 2007 11:59:31 AM
Old 08-30-2007
It seems to be printing out the right output. Say I wanted to replace the 30 with a variable $previousday, would this still hold up?

Last edited by Nysif Steve; 08-30-2007 at 01:05 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

printing a line of a file

I am trying to write a script that when triggered by an ip address it will run the following export DAVIDCOUNT=`(fgrep -ce 140.147.146.146 /export/home/ipconnect.txt) >> /local/cron/test_listen_out`; I think this is my problem line. What I like this line to do is when it sees the... (6 Replies)
Discussion started by: clay
6 Replies

2. Shell Programming and Scripting

printing an empty line in a file (perl)

I know this must be really easy, but i can't get it to work I've got a perl script, with a file. I want to print an empty line, and the following doesn't seem to work: print nameoffile "\n" thanks for your help!! (3 Replies)
Discussion started by: kfad
3 Replies

3. Shell Programming and Scripting

Re-write first line of a file before printing

Morning All, Quite a simple one this, I hope. What I want to do is to re-write the first line of a file before it's sent to print. The line will be blank initially, and I want to insert some text. The operation can either be done on the file itself (modifying the file on disk), OR in a... (2 Replies)
Discussion started by: alexop
2 Replies

4. UNIX for Advanced & Expert Users

printing specific line from a file.

The below line gives the perfect output when I mention the record number and file name as hardcoded. awk 'NR==3{print}' samp2.txt But when I pass the record num and file name as variable, it doesn't give any output. row_num=3;file2=samp2.txt;awk 'NR==$row_num {print}' $file2 Can you... (2 Replies)
Discussion started by: siba.s.nayak
2 Replies

5. Shell Programming and Scripting

printing each line in a file X times

This is probably simple but I would like to print every line in a file 5 times like this: awk 'NR' mens_csv.tab Dub Tank 53%Hemp/42%Cotton/5%Lycra Jersey Dark Green 0 $22.50 Dub Tank 53%Hemp/42%Cotton/5%Lycra Jersey Indigo Blue 0 $22.50 --------------- Dub... (4 Replies)
Discussion started by: Autumn Tree
4 Replies

6. Shell Programming and Scripting

Printing a particular line to a file

Hi, I have a file in which the entries are of the following type: 5649 S 1 0412 S 0 0423 S 1 0020 N 0 0020 N 0 1022 S 1 1022 S 1 I need to print the whole line which is having 0 in the third column into a different file Thanks... (6 Replies)
Discussion started by: swasid
6 Replies

7. UNIX and Linux Applications

Printing a line in a file

Hi I have a file having multiple lines. I want to print a particular line. How can I do this? Thanks in advance Ananth (5 Replies)
Discussion started by: Ananthdoss
5 Replies

8. Homework & Coursework Questions

Lex: analyzing a C file and printing out identifiers and line numbers they're found on

Florida State University, Tallahassee, FL USA, Dr. Whalley, COP4342 1. The problem statement, all variables and given/known data: Create a lex specification file that reads a C source program that ignores keywords and collects all identifiers (regular variable names) and also displays the line... (3 Replies)
Discussion started by: D2K
3 Replies

9. Shell Programming and Scripting

Awk: Comparing arguments with in line values of file and printing the result

I need to develop a script where I will take two date arguments as parameter date1 and date2 which will in format YYYYMM. Below is the input file say sample.txt. sample.txt will have certain blocks starting with P1. Each block will have a value 118,1:TIMESTAMP. I need to compare the... (7 Replies)
Discussion started by: garvit184
7 Replies

10. Shell Programming and Scripting

Printing string from last field of the nth line of file to start (or end) of each line (awk I think)

My file (the output of an experiment) starts off looking like this, _____________________________________________________________ Subjects incorporated to date: 001 Data file started on machine PKSHS260-05CP ********************************************************************** Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies
cupsenable(8)							    Apple Inc.							     cupsenable(8)

NAME
cupsdisable, cupsenable - stop/start printers and classes SYNOPSIS
cupsdisable [ -E ] [ -U username ] [ -c ] [ -h server[:port] ] [ -r reason ] [ --hold ] destination(s) cupsenable [ -E ] [ -U username ] [ -c ] [ -h server[:port] ] [ --release ] destination(s) DESCRIPTION
cupsenable starts the named printers or classes while cupsdisable stops the named printers or classes. OPTIONS
The following options may be used: -E Forces encryption of the connection to the server. -U username Uses the specified username when connecting to the server. -c Cancels all jobs on the named destination. -h server[:port] Uses the specified server and port. --hold Holds remaining jobs on the named printer. Useful for allowing the current job to complete before performing maintenance. -r "reason" Sets the message associated with the stopped state. If no reason is specified then the message is set to "Reason Unknown". --release Releases pending jobs for printing. Use after running cupsdisable with the --hold option to resume printing. CONFORMING TO
Unlike the System V printing system, CUPS allows printer names to contain any printable character except SPACE, TAB, "/", or "#". Also, printer and class names are not case-sensitive. The System V versions of these commands are disable and enable, respectively. They have been renamed to avoid conflicts with the bash(1) build-in commands of the same names. The CUPS versions of disable and enable may ask the user for an access password depending on the printing system configuration. This dif- fers from the System V versions which require the root user to execute these commands. SEE ALSO
cupsaccept(8), cupsreject(8), cancel(1), lp(1), lpadmin(8), lpstat(1), CUPS Online Help (http://localhost:631/help) COPYRIGHT
Copyright (C) 2007-2017 by Apple Inc. 11 June 2014 CUPS cupsenable(8)
All times are GMT -4. The time now is 02:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy