Hi!
I've just started learning shell scripting, and have been somewhat 'thrown in at the deep-end and told to swim' so excuse my complete lack of knowledge and ignorance, but here goes...
I've been given a unix script to 'tidy up'. Basically the script consists of the few lines of code being... (2 Replies)
Is it possible to make function variables local?
I mean for example, I have a script variable 'name' and in function I have declared variable 'name'
I need to have script's 'name' have the same value as it was before calling the function with the same declaration.
The way to preserve a... (5 Replies)
I want to build a Makefile that simply takes a template file and modifies it (sed or perl, probably) before installing the result in the right place - my problem is creating the variable for substitution...
So I have
SYSTEM = SYS1 SYS2
SYS1_CHANNELS = CHANNEL1 CHANNEL2 CHANNEL4... (1 Reply)
Hey, I'm trying to make a nice clear table of fixtures.
lynx --dump Fixtures & Reports | Fixtures | Arsenal.com | tail -n+360 | less
#tail to remove 1st 360 line
I'm trying to remove the 'Add to Calendar' bit next
I tried pipping through sed but not sure if I did it right
sed 's/\Add... (3 Replies)
Hi,
Basically what I am trying to do is the following.
I have created a shell script to grab timetabling information from a website using curl then I crop out only the data I need which is a table based on the current date. It leaves me with a file that has the table I want plus a small amount... (2 Replies)
how do I make sure that the entry in the routing table on Solaris 8 stay permanent after rebooting the server.
For example
route add 172.20.1.60 -netmask 255.255.255.0 172.20.255.253
Each time the server reboots the entry disappears when using the command netstat -nr (2 Replies)
Hello Everyone,
I want to know how can we make the variables of one script available for the other script?
for example i have three scripts variable_availability.sh,first.sh,second.sh and a file containing variables called common
----------------------------------
cat variable_availability.sh... (2 Replies)
I have a flat file (template) where I want to replace variables based upon a value in another file (csv).
The variables in the template are named %VAR_X_z%
The values are in the csv file and X is field 0 of each line and y field 1 and up.
Example of the csv:
Badidas, 13.00, 12.00, 11.00,... (8 Replies)
Hi,
I have a pipe separated text file.
Can some someone tell me how to convert it to a table?
Text File contents.
|Activities|Status1|Status2|Status3|
||NA|$io_running2|$io_running3|
|Replication Status|NA|$running2|$running3|
||NA|$master2|$master3|... (1 Reply)
Hi am new to unix ,
when the background task is running how to put entry in the table and also if there is any issue how to stop the running task.
can anyone help me... (1 Reply)
Discussion started by: Venkatesh1
1 Replies
LEARN ABOUT DEBIAN
file::type::builder
File::Type::Builder(3pm) User Contributed Perl Documentation File::Type::Builder(3pm)NAME
File::Type::Builder - parse mime-magic and generate code
SYNOPSIS
my $build = File::Type::Builder->new();
while (<magic>) {
chomp;
my $parsed = $build->parse_magic($_);
my $code = $build->string_start($parsed);
(or string_offset or beshort)
}
DESCRIPTION
Reads in the mime-magic file format and translates it to code. (This documentation would be longer if I really expected anyone other than
me to run the code.)
METHODS
new
Creates a new File::Type::Builder object.
parse_magic
Pulls apart a line of a mime-magic file using a string of regular expressions.
An example mime-magic file can be found in cleancode CVS at <http://cleancode.org/cgi-bin/viewcvs.cgi/email/mime-magic.mime?rev=1.1.1.1>
string
Builds code to match magic that's of type string.
Has to do some cleverness to make the regular expression work properly.
be
Builds code to match 'beshort' and 'belong' magic (eg audio/mpeg, image/jpeg).
PRIVATE METHODS
_substr_matching
Sometimes the data is smaller than the offset we're looking for in the file. If this is the case, then the file is obviously not of that
type, and furthermore we should avoid issuing a couple of warnings that Perl would otherwise emit.
This subroutine generates this code.
_get_escapes
Returns a reference to a hash defining characters that should not be escaped.
TODO
* Add handlers for other magic types (bedate, byte, etc)
* Make verbosity/logging nicer.
* Find more edge cases.
* Remove redundant 'if (length $data > 0)' check.
Longer term:
* Fix for multiple magic format types?
BUGS
Incomplete. Some known issues with odd entries in mime-magic. Skips some mime-magic lines.
SEE ALSO
File::Type, which is partially generated by this module.
AUTHOR
Paul Mison <pmison@fotango.com>
COPYRIGHT
Copyright 2003 Fotango Ltd.
LICENSE
Licensed under the same terms as Perl itself.
perl v5.8.8 2004-10-08 File::Type::Builder(3pm)