8 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi guys,
I have the following code:
int main(int argc, char *argv)
{
int pid1,pid2,i=0;
pid1=fork();
i+=2;
if(!pid1) i++;
if(i%3) pid2=fork();
if (pid2==0)
{
printf("sea \n ");
i-=1;
}
if(i>=2)... (4 Replies)
Discussion started by: pfpietro
4 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have used pdftotext with good results in the past, but today for some reason I keep getting the same error message.
My command is as follows:
And the error message is
I am using Vmware player with Ubuntu server, but I don't think that is causing this issue as I have been using... (2 Replies)
Discussion started by: Joq
2 Replies
3. UNIX for Dummies Questions & Answers
I am using the following code:
if ; then
I am getting an error saying line 12:
The code is supposed to examine whether the filename read into $FILE includes the string IMG*. I do have a fi later in the script, but I must be missing something obvious. Can anyone help? (3 Replies)
Discussion started by: Bengel
3 Replies
4. Shell Programming and Scripting
Hello, I am new to the Bash scripting language, and was given a tutorial page on how to setup a file. However I am trying to use cygwin to run this file and it is not working.
$ vi averagetime.sh
#
#
#
echo "Enter Dictorinary File Text "
read dict
echo "Enter Grid Name"
read grid... (13 Replies)
Discussion started by: killerqb
13 Replies
5. UNIX for Dummies Questions & Answers
Hello all
I am having problems using a bash script to read the input from the user and checking that its a valid number. I only want the user to input a maximum of a 3 number string (321 , 521 , 871 etc.). Anything longer or that includes a chararcter or symbol will display an error message.
... (8 Replies)
Discussion started by: ChrisHoogie
8 Replies
6. UNIX for Dummies Questions & Answers
Alright i'm having problems with this loop. Basically once the script is ran a parameter is required. Once entering the parameter it displays that in LIMIT. Alright so now the problem, I need my loop to ask my user for a number, and if that number is less than the limit then sum the input values... (4 Replies)
Discussion started by: tragic54
4 Replies
7. Shell Programming and Scripting
How to make this script?
1. Write a portable bash shell script called change_password.bash that will
prompt the user for a password. Use a series of if statements to test if:
1.
The password is NOT 6 or more characters
2.
The password does not contain at least 3 consecutive letters... (1 Reply)
Discussion started by: 3junior
1 Replies
8. Programming
I am trying to learn how to use multiple modules and hearder files. I have tried a little experiment but cannot get it to work. Here is my code and compilation attempt. Any help with finding my problems appreciated.
The main function (main01.c) calls a function located in another file... (9 Replies)
Discussion started by: enuenu
9 Replies
MasonX::ProcessDir(3pm) User Contributed Perl Documentation MasonX::ProcessDir(3pm)
NAME
MasonX::ProcessDir - Process a directory of Mason 2 templates
VERSION
version 0.02
SYNOPSIS
use MasonX::ProcessDir;
# Generate result files in the same directory as the templates
#
my $pd = MasonX::ProcessDir->new(
dir => '/path/to/dir'
);
$pd->process_dir();
# Generate result files in a separate directory
#
my $pd = MasonX::ProcessDir->new(
source_dir => '/path/to/source/dir',
dest_dir => '/path/to/dest/dir'
);
$pd->process_dir();
DESCRIPTION
Recursively processes a directory of Mason 2 templates, generating a set of result files in the same directory or in a parallel directory.
Every file with suffix ".mc" will be processed, and the results placed in a file of the same name without the suffix. ".mi", autobase and
dhandler files will be used by Mason when processing the templates but will not generate files themselves.
For example, if the source directory contains
Base.mc
httpd.conf.mc
proxy.conf.mc
etc/crontab.mc
blah.mi
somefile.txt
and we run
my $pd = MasonX::ProcessDir->new(
source_dir => '/path/to/source/dir',
dest_dir => '/path/to/dest/dir'
);
$pd->process_dir();
then afterwards the destination directory will contain files
httpd.conf
proxy.conf
etc/crontab
somefile.txt
where foo and bar are the results of processing foo.mc and bar.mc through Mason. Base.mc and blah.mi may be used during Mason processing
but won't generate result files themselves.
This class is a convenience extension of Any::Template::ProcessDir.
CONSTRUCTOR
Specifying directory/directories
o If you want to generate the result files in the same directory as the templates, just specify dir.
my $pd = MasonX::ProcessDir->new(
dir => '/path/to/dir',
...
);
o If you want to generate the result files in a separate directory from the templates, specify source_dir and dest_dir.
my $pd = MasonX::ProcessDir->new(
source_dir => '/path/to/source/dir',
source_dir => '/path/to/dest/dir',
...
);
Mason options
mason_options
An optional hash of options to the Mason interpreter. For example, the default Mason data directory will be ".mason" under the source
directory, but you can override this:
mason_options => { data_dir => '/path/to/data/dir' }
Options inherited from Any::Template::ProcessDir
See Any::Template::ProcessDir for other options, such as
dir_create_mode
file_create_mode
readme_filename
SUPPORT AND DOCUMENTATION
Bugs and feature requests will be tracked at RT:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=MasonX-ProcessDir
bug-masonx-processdir@rt.cpan.org
The latest source code can be browsed and fetched at:
http://github.com/jonswar/perl-masonx-processdir
git clone git://github.com/jonswar/perl-masonx-processdir.git
SEE ALSO
Mason, Any::Template::ProcessDir
AUTHOR
Jonathan Swartz <swartz@pobox.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Jonathan Swartz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-03-07 MasonX::ProcessDir(3pm)