Hello, I'm writing a bash script and I have a question.
Here's what I'm doing:
I have a file called inv.dat which contains the following:
B102:Action Figure - Teacher:79
B103:Bike - Purple:23
B104:Baseball:25
B105:Cricket Bat:15
B101:Action Figure - Fireman:15
B100:Flame-Thrower:25
... (2 Replies)
In a bash script I've set a variable that is the directory name of where an executable lives.
the_dir=`dirname $which myscript`
which equates to something like "/path/to/dir/bin"
I need to cut that down to remove the "bin" so I now have "/path/to/dir/".
This sounds easy but as a... (2 Replies)
Hey all, Im kind of lost on how to do what I want so I figured I would ask.
I want to pipe STDOUT of an app to a log file, but I want to prepend each line of that output with the date and time.
Im drawing a complete blank on how to do this?? Any ideas?
i.e.
output is currently this:... (9 Replies)
EDIT: This has been SOLVED. Thanks!
Greetings everyone,
I've posted a few threads with some quick help questions, and this is another one of those. I can't post enough gratitude for those much more knowledgeable than myself who are willing to give good advice for my minor issues. Now,... (2 Replies)
Hi All,
I am using a bash shell and want to the following thing.
A process sends the following string to my script
BACKUP_FAIL_REASON="Failed - Application Dump CDMACA-0:grep: /opt/nortel/ca/data/1245184/sd00/image1/S110907070708HIS... (4 Replies)
I don't know if this is a big issue or not, but I'm having difficulties. I apoligize for the upcoming essay :o.
I'm writing a script, similar to a paint program that edits images, but in the form of ANSI block characters. The program so far is working. I managed to save the image into a file,... (14 Replies)
Hello guys,
here is my problem:
I got a shell script which is called by an external piece of software, the external software is not under my control. The software passes data as an argument to my script like
./bla.sh 'service;1234567890;ok;hostname;some text here'
I need to pass the... (3 Replies)
In my script I'm retrieving a parameter through an API call. I need to trim some things out of the result so I can use it as a parameter to pass to another process. I've got it working but it's pretty kludgy and I'm hoping someone can help me with a better way.
This is the code that retrieves... (2 Replies)
seeking assistance on comparing two arrays using bash:
array1=(disk1, disk2, disk3, disk5, disk7, vol1, vol2, vol3, vol4, vol5)
array2=(disk2, disk5 vol2, vol4 )
1) if two arrays have same elements; EXIT
else populate array3 & array4 with elements that are different between array1 & array2 as:... (3 Replies)
Guys, I have a variable in a script that I want to transform to into something else Im hoping you guys can help. It doesn't have to use sed/awk but I figured these would be the simplest.
DATE=20160120
I'd like to transform $DATE into "01-20-16" and move it into a new variable called... (8 Replies)
Discussion started by: dendenyc
8 Replies
LEARN ABOUT DEBIAN
rdf::vcard::line
RDF::vCard::Line(3pm) User Contributed Perl Documentation RDF::vCard::Line(3pm)NAME
RDF::vCard::Line - represents a line within a vCard
DESCRIPTION
Instances of this class correspond to lines within vCards, though they could potentially be used as basis for other RFC 2425-based formats
such as iCalendar.
Constructor
o "new(%options)"
Returns a new RDF::vCard::Line object.
The only options worth worrying about are: property (case-insensitive property name), value (arrayref or single string value),
type_parameters (hashref of property-related parameters).
RDF::vCard::Entity overloads stringification, so you can do the following:
my $line = RDF::vCard::Line->new(
property => 'email',
value => 'joe@example.net',
type_parameters => { type=>['PREF','INTERNET'] },
);
print "$line
" if $line =~ /internet/i;
Methods
o "to_string()"
Formats the line according to RFC 2425 and RFC 2426.
o "add_to_model($model, $node)"
Given an RDF::Trine::Model and an RDF::Trine::Node representing the entity (i.e. vcard) that this line belongs to, adds triples to the
model for this line.
o "property()"
Returns the line's property - e.g. "EMAIL".
o "property_node()"
Returns the line's property as an RDF::Trine::Node that can be used as an RDF predicate. Returns undef if a sensible URI cannot be
found.
o "property_order()"
Returns a string which can be used to sort a list of lines into a sensible order.
o "value()"
Returns an arrayref for the value. Each item in the arrayref could be a plain scalar, or an arrayref of scalars. For example the
arrayref representing this name:
N:Smith;John;Edward,James
which is the vCard representation of somebody with surname Smith, given name John and additional names (middle names) Edward and James,
might be represented with the following "value" arrayref:
[
'Smith',
'John',
['Edward', 'James'],
]
or maybe:
[
['Smith'],
'John',
['Edward', 'James'],
]
That's why it's sometimes useful to have a normalised version of it...
o "nvalue()"
Returns a normalised version of the arrayref for the value. It will always be an arrayref of arrayrefs. For example:
[
['Smith'],
['John'],
['Edward', 'James'],
]
o "value_node()"
Returns the line's value as an RDF::Trine::Node that can be used as an RDF object. For some complex properties (e.g. ADR, GEO, ORG, N,
etc) the result is not especially useful.
o "value_to_string()"
Formats the line value according to RFC 2425 and RFC 2426.
o "type_parameters()"
Returns the type_parameters hashref. Here be monsters (kinda).
SEE ALSO
RDF::vCard.
AUTHOR
Toby Inkster <tobyink@cpan.org>.
COPYRIGHT
Copyright 2011 Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-06-23 RDF::vCard::Line(3pm)