Sponsored Content
Top Forums Shell Programming and Scripting sed command throwing error while deleting a line from a file Post 302902822 by vivek d r on Thursday 22nd of May 2014 11:34:27 AM
Old 05-22-2014
Hi Corona, i have posted the contents of lineno using echo. it has "1"


Printf output is coming as below

Code:
here 1 : lineno: 1
'ed: -e expression #1, char 2: unknown command: `
here 2
'ed: -e expression #1, char 2: unknown command: `
print f output is below:
]1


Last edited by vivek d r; 05-22-2014 at 12:40 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Deleting all content in a file from command line

Hey guys, I'd like to delete all text within a text file without actually deleting the file. Is there a vi command I can do from my prompt without actually going into the file and doing a %d i think it is... to remove all the text inside? I want to add this to a cron job to erase all the data... (2 Replies)
Discussion started by: kingdbag
2 Replies

2. UNIX for Dummies Questions & Answers

Remote login/copy command throwing an error

Hi We had 3 server -hp112and hp146 here hp112 is production server and hp146 is staging server used for load. when i am trying to run follwing command rcp abc hp112:/dnbusr1/gbid/gbid02 it's trowing an error :- remshd: Login incorrect. But same command is working wise versa - rcp abc... (1 Reply)
Discussion started by: ashish_panpalia
1 Replies

3. Shell Programming and Scripting

Deleting a line from a file with sed and awk?

cat file.txt fvnuiehuewf ruevhxncvkjrh zxjvurhfuwe jkhvBEGINvfnvf ijrgioe Trying to delete a line that has the pattern "BEGIN" cat sedtest filename=file.txt pattern=BEGIN sed "/^$pattern/d" "$filename" (9 Replies)
Discussion started by: cola
9 Replies

4. Shell Programming and Scripting

deleting blank line and row containing certain words in single sed command

Hi Is it possible to do the following in a single command /usr/xpg4/bin/sed -e '/rows selected/d' /aemu/CALLAUTO/callauto.txt > /aemu/CALLAUTO/callautonew.txt /usr/xpg4/bin/sed -e '/^$/d' /aemu/CALLAUTO/callautonew.txt > /aemu/CALLAUTO/callauto_new.txt exit (1 Reply)
Discussion started by: aemunathan
1 Replies

5. UNIX for Dummies Questions & Answers

Mailx command in unix shell script, its throwing below error

How to use Mailx command in unix shell script, its throwing below error #!/bin/ksh let x=3 If ; then mailx -s “ $x is greater than 2” example@gmail.com << EOF This is the message body EOF fi its throwing error as syntax error at EOF... (10 Replies)
Discussion started by: only4satish
10 Replies

6. UNIX for Dummies Questions & Answers

Deleting "user input line number" from a file using sed

Hi I want to delete a line from a txt file for which the line number is user input. Say when user selects 19, the 19th line would be deleted from the file. Can anyone please provide me with a sed one liner for the same... I tried sed -i. The interaction would be like this Enter the line to... (1 Reply)
Discussion started by: sudeep.id
1 Replies

7. Shell Programming and Scripting

for loop with internal unix command in statement throwing error

Hi I've gotten a plugin script that won't run. I keeps throwing an error at the following line. for BARCODE_LINE in `cat ${TSP_FILEPATH_BARCODE_TXT} | grep "^barcode"` do #something done The error reads ... (3 Replies)
Discussion started by: jdilts
3 Replies

8. Shell Programming and Scripting

Deleting "user input line number" from a file using sed

Hi I want to delete a line from a txt file for which the line number is user input. Say when user selects 19, the 19th line would be deleted from the file. Can anyone please provide me with a sed one liner for the same... I tried sed -i. The interaction would be like this Enter the line... (4 Replies)
Discussion started by: sudeep.id
4 Replies

9. Shell Programming and Scripting

sed and awk giving error ./sample.sh: line 13: sed: command not found

Hi, I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :- ./sample.sh: line... (12 Replies)
Discussion started by: satishmallidi
12 Replies

10. Shell Programming and Scripting

sed command within script wrongly deleting the last line

Hi, I have a shell script which has a for loop that scans list of files and do find and replace few variables using sed command. While doing this, it deletes the last line of all input file which is something wrong. how to fix this. please suggest. When i add an empty line in all my input file,... (5 Replies)
Discussion started by: rbalaj16
5 Replies
DPKG::Log::Entry(3pm)					User Contributed Perl Documentation				     DPKG::Log::Entry(3pm)

NAME
DPKG::Log::Entry - Describe a log entry in a dpkg.log VERSION
version 1.20 SYNOPSIS
use DPKG::Log::Entry; $dpkg_log_entry = DPKG::Log::Entry->new( line => $line, $lineno => 1) $dpkg_log_entry->timestamp($dt); $dpkg_log_entry->associated_package("foo"); DESCRIPTION
This module is used to describe one line in a dpkg log by parameterizing every line into generic parameters like o Type of log entry (startup-, status-, action-lines) o Timestamp o Subject of log entry (e.g. package, packages or archives) o Package name (if log entry refers to a package subject) and so on. The various parameters are described below together with the various methods to access or modify them. METHODS
$dpkg_log_entry = PACKAGE->new( 'line' => $line, 'lineno' => $lineno ) Returns a new DPKG::Log::Entry object. The arguments line and lineno are mandatore. They store the complete line as stored in the log and the line number. Additionally its possible to specify every attribute the object can store, as 'key' => 'value' pairs. ATTRIBUTES
$dpkg_log_entry->line() / line Return the full log line. This attribute is set on object initialization. $dpkg_log_entry->lineno() / lineno Return the line number of this entry. This attribute is set on object initialization. $dpkg_log_entry->timestamp() / timestamp Get or set the timestamp of this object. Should be a DateTime object. $dpkg_log_entry->type() / type Get or set the type of this entry. Specifies weither this is a startup, status or action line. $dpkg_log_entry->associated_package() / associated_package Get or set the associated_package of this entry. This is for lines that are associated to a certain package like in action or status lines. Its usually unset for startup and status lines. $dpkg_log_entry->action() / action Get or set the action of this entry. This is for lines that have a certain action, like in startup-lines (unpack, configure) or action lines (install, remove). It is usally unset for status lines. $dpkg_log_entry->status() / status Get or set the status of the package this entry refers to. $dpkg_log_entry->subject() / subject Gets or Defines the subject of the entry. For startup lines this is usually 'archives' or 'packages' for all other lines its 'package'. $dpkg_log_entry->installed_version() / installed_version Gets or Defines the installed_version of the package this entry refers to. It refers to the current installed version of the package depending on the current status. Is "<none>" (or similar) if action is 'install', old version in case of an upgrade. $dpkg_log_entry->available_version() / available_version Gets or Defines the available_version of the package this entry refers to. It refers to the currently available version of the package depending on the current status. Is different from installed_version if the action is install or upgrade. $dpkg_log_entry->conffile() / conffile Get or set a conffile for a line indicating a conffile change. $dpkg_log_entry->decision() / decision Gets or defines the decision for a line indicating a conffile change. SEE ALSO
DateTime AUTHOR
Patrick Schoenfeld <schoenfeld@debian.org>. COPYRIGHT AND LICENSE
Copyright (C) 2011 Patrick Schoenfeld <schoenfeld@debian.org> This library is free software. You can redistribute it and/or modify it under the same terms as perl itself. perl v5.10.1 2011-02-23 DPKG::Log::Entry(3pm)
All times are GMT -4. The time now is 09:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy