Sponsored Content
Top Forums Shell Programming and Scripting Hint needed for incrementing numbers Post 302934331 by RudiC on Friday 6th of February 2015 08:01:40 AM
Old 02-06-2015
This might be a Useful Use Of Cat:
Code:
cat -n file | while read NR REST; do echo "fruit etc. $REST is in basket$(((NR+1)/2))"; done

These 2 Users Gave Thanks to RudiC For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

incrementing a for loop

I have, LIST="a b c d e" for word in $LIST do echo $word done would give me a b c d e With the first iteration of the for loop, I get "a" as the result. Is it possible that I get both "a" and "b" in only the first iteration. In the next iteration I get "c" and "d" and so on.... (2 Replies)
Discussion started by: run_time_error
2 Replies

2. Programming

hint on ansi c

I am a student. And need help on following program. I want to make a c program. I have to scan a sentence and I have to interchange a word from that sentence. Example: Scan the sentence is " Drilling machine and Milling machine " . Replace the word "machine" by "operation". And output should... (2 Replies)
Discussion started by: dhaval chevli
2 Replies

3. UNIX for Dummies Questions & Answers

SSLSessionCache hint

Folks; I just installed Apache2.2.6 on Solaris 10 & when i try to start it, i got this message in the error.log file: Init: Session Cache is not configured Any help? Thanks in advance (2 Replies)
Discussion started by: moe2266
2 Replies

4. Post Here to Contact Site Administrators and Moderators

No. post not incrementing

Hi Admin, i just noticed that when I do postings, the number does not increment. eg : Post A -Total Posts 312 Post B - Total Posts 312 Post C - Total Posts 313 Post D - Total Posts 313 Why is this so? Can you kindly check this out? Thank you. (5 Replies)
Discussion started by: incredible
5 Replies

5. Shell Programming and Scripting

Incrementing in while loop

echo "Enter Starting id:" echo "" read rvst_strt_idxx echo "" echo "Enter Closing id:" echo "" read rvst_clsn_idxx FIELD1=$rvst_strt_idxx FIELD2="USER" FIELD3="TEST" FIELD4="12345" FIELD5="00000" echo "" echo "INSERT INTO TABLE( FIELD1, FIELD2, FIELD3, FIELD4, ... (7 Replies)
Discussion started by: ultimatix
7 Replies

6. Programming

incrementing variables in C++

Hello, what is the result of the below, and how does it work? int i = 5; cout << i++ * ++i << endl; cout << i << endl; (12 Replies)
Discussion started by: milhan
12 Replies

7. Windows & DOS: Issues & Discussions

Give Win Explorer a hint to graphics files w/o extensions?

All: Benjamin Fournier wrote a plug-in for the graphics application PhotoFiltre Studio that inspired me, since I also happen to use the XnView Shell Extension and have seen what it can do, to look into the possibility of getting Windows XP Pro SP3's Explorer file navigator to "hazard a guess at"... (1 Reply)
Discussion started by: SilversleevesX
1 Replies

8. Shell Programming and Scripting

Change numbers in a file, incrementing them

Hello, Here's a file of mine: key1:431 key2:159 key3:998 I need to change these keys to something bigger - and I actually need to shift them all by a range of 3. The output would be: key1:434 key2:162 key3:1001 I can't find the propper sed/awk line that would alter all my... (4 Replies)
Discussion started by: fzd
4 Replies

9. Shell Programming and Scripting

help needed to put instance numbers

Hi All I need help am having a source file as below emp dept class subclass region country division first i need to get line count and i need to divide by 3 it is an parameter passing value number of lines 7 (8 Replies)
Discussion started by: ragu.selvaraj
8 Replies
RT::Client::REST::Ticket(3pm)				User Contributed Perl Documentation			     RT::Client::REST::Ticket(3pm)

NAME
RT::Client::REST::Ticket -- this object represents a ticket. SYNOPSIS
my $rt = RT::Client::REST->new(server => $ENV{RTSERVER}); # Create a new ticket: my $ticket = RT::Client::REST::Ticket->new( rt => $rt, queue => "General", subject => $subject, )->store(text => "This is the initial text of the ticket"); print "Created a new ticket, ID ", $ticket->id, " "; # Update my $ticket = RT::Client::REST::Ticket->new( rt => $rt, id => $id, priority => 10, )->store; # Retrieve my $ticket => RT::Client::REST::Ticket->new( rt => $rt, id => $id, )->retrieve; unless ($ticket->owner eq $me) { $ticket->steal; # Give me more work! } DESCRIPTION
RT::Client::REST::Ticket is based on RT::Client::REST::Object. The representation allows one to retrieve, edit, comment on, and create tickets in RT. ATTRIBUTES
id This is the numeric ID of the ticket. queue This is the name of the queue (not numeric id). owner Username of the owner. creator Username of RT user who created the ticket. subject Subject of the ticket. status The status is usually one of the following: "new", "open", "resolved", "stalled", "rejected", and "deleted". However, custom RT installations sometimes add their own statuses. priority Ticket priority. Usually a numeric value. initial_priority final_priority requestor This is the attribute for setting the requestor on ticket creation. If you use requestors to do this in 3.8, the recipient may not receive an autoreply from RT because the ticket is initially created as the user your REST session is connected as. It is a list attribute (for explanation of list attributes, see LIST ATTRIBUTE PROPERTIES in RT::Client::REST::Object). requestors This contains e-mail addresses of the requestors. It is a list attribute (for explanation of list attributes, see LIST ATTRIBUTE PROPERTIES in RT::Client::REST::Object). cc A list of e-mail addresses used to notify people of 'correspond' actions. admin_cc A list of e-mail addresses used to notify people of all actions performed on a ticket. created Time at which ticket was created. Note that this is an immutable field and therefore the value cannot be changed.. starts started due resolved told time_estimated time_worked time_left last_updated DB METHODS
For full explanation of these, please see "DB METHODS" in RT::Client::REST::Object documentation. retrieve Retrieve RT ticket from database. store ([text => $text]) Create or update the ticket. When creating a new ticket, optional 'text' parameter can be supplied to set the initial text of the ticket. search Search for tickets that meet specific conditions. TICKET-SPECIFIC METHODS comment (message => $message, %opts) Comment on this ticket with message $message. %opts is a list of key-value pairs as follows: attachments List of filenames (an array reference) that should be attached to the ticket along with the comment. cc List of e-mail addresses to send carbon copies to (an array reference). bcc List of e-mail addresses to send blind carbon copies to (an array reference). correspond (message => $message, %opts) Add correspondence to the ticket. Takes exactly the same arguments as the comment method above. attachments Get attachments associated with this ticket. What is returned is an object of type RT::Client::REST::SearchResult which can then be used to get at objects of type RT::Client::REST::Attachment. transactions Get transactions associated with this ticket. Optionally, you can specify exactly what types of transactions you want listed, for example: my $result = $ticket->transactions(type => [qw(Comment Correspond)]); Please reference RT::Client::REST documentation for the full list of valid transaction types. Return value is an object of type RT::Client::REST::SearchResult which can then be used to iterate over transaction objects (RT::Client::REST::Transaction). take Take this ticket. If you already the owner of this ticket, "RT::Client::REST::Object::NoopOperationException" will be thrown. untake Untake this ticket. If Nobody is already the owner of this ticket, "RT::Client::REST::Object::NoopOperationException" will be thrown. steal Steal this ticket. If you already the owner of this ticket, "RT::Client::REST::Object::NoopOperationException" will be thrown. CUSTOM FIELDS
This class inherits 'cf' method from RT::Client::REST::Object. To create a ticket with a bunch of custom fields, use the following approach: RT::Client::REST::Ticket->new( rt => $rt, # blah blah cf => { 'field one' => $value1, 'field two' => $another_value, }, )->store; Some more examples: # Update a custom field value: $ticket->cf('field one' => $value1); $ticket->store; # Get a custom field value: my $another value = $ticket->cf('field two'); # Get a list of ticket's custom field names: my @custom_fields = $ticket->cf; INTERNAL METHODS
rt_type Returns 'ticket'. SEE ALSO
RT::Client::REST, RT::Client::REST::Object, RT::Client::REST::Attachment, RT::Client::REST::SearchResult, RT::Client::REST::Transaction. AUTHOR
Dmitri Tikhonov <dtikhonov@yahoo.com> LICENSE
Perl license with the exception of RT::Client::REST, which is GPLed. perl v5.14.2 2012-01-20 RT::Client::REST::Ticket(3pm)
All times are GMT -4. The time now is 01:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy