Sponsored Content
Top Forums Shell Programming and Scripting Help understanding perl script Post 303012271 by Don Cragun on Thursday 1st of February 2018 03:33:17 PM
Old 02-01-2018
It is kind of hard to answer a question like that without seeing the contents of /usr/local/src/files.txt, but the time range would be specified by the 2nd "field" in that file.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help understanding perl script error

I solicited this site earlier this week and got a good answer for a perl Script so I made this script from what understood from the answers But now I have a bug and I'm stump. It doesn't parse correctly the Output it stays on the first line My $f2 and reprints in a endless loop I'm sure there... (3 Replies)
Discussion started by: Ex-Capsa
3 Replies

2. Shell Programming and Scripting

perl command understanding

Hi All, Can you please help me interpret the following command. Which I am not able to understand. Also can you please illustrate what it is used for. perl -pi -e 's/\015//g' text_file.dat Regards (3 Replies)
Discussion started by: rakesh.su30
3 Replies

3. Shell Programming and Scripting

Perl: Understanding @allwords

Hi guys, Here is the code: my @allwords = (); my %seen=(); foreach my $curr (@allwords) { $seen{$curr} = 1; } @allwords = keys %seen; my question is: what will @allwords now contain, or how would the entries in the @allwords array be different after this manipulation? Thank... (3 Replies)
Discussion started by: 300zxmuro
3 Replies

4. Shell Programming and Scripting

Understanding perl statement

can someone help me how to interpret this line? my ($class, $hashref) = @_; my $portfolio = {}; if ($hashref->{portfolio_id}) { ($portfolio) = GEmySQL->get ("select * from portfolio where portfolio.id=$hashref->{portfolio_id}"); } =============== Question: how do... (2 Replies)
Discussion started by: onlinelearner02
2 Replies

5. Shell Programming and Scripting

Help understanding Perl code.

Well, I found myself trying to fix some Perl code (Ive never done any Perl in my life) and I pinpointed the place where the bug could be. But to be sure I have to know what does a few line of code mean: $files_lim =~ (/^\d*$/) $files_lim =~ (/^\d*h$/)$files_age =~ s/h//The code where this was... (0 Replies)
Discussion started by: RedSpyder
0 Replies

6. Shell Programming and Scripting

Help understanding some Perl code.

Well, I found myself trying to fix some Perl code (Ive never done any Perl in my life) and I pinpointed the place where the bug could be. But to be sure I have to know what does a few line of code mean: $files_lim =~ (/^\d*$/) $files_lim =~ (/^\d*h$/) $files_age =~ s/h// The code where... (2 Replies)
Discussion started by: RedSpyder
2 Replies

7. Shell Programming and Scripting

Please suggest the Sites for perl script beginners for better understanding

I am begginer to perl scripting, i like to learn all the functionality of the perl scrpting , Could you please help me on this :confused::confused: (2 Replies)
Discussion started by: jothi basu
2 Replies

8. Programming

Understanding perl code

What is the difference between the two statements below? A: $a->{"$fruit"}->{"$color"}->{size} = $size B: $size = $a->{"$fruit"}->{"$color"}->{size} Please assist. Thanks! (0 Replies)
Discussion started by: onlinelearner02
0 Replies

9. Shell Programming and Scripting

Help with perl code understanding

Hi, I need to understand below perl code, can some one advise me. perl -MDate::Parse -e'BEGIN{$main::now=time;$main::old=(time-60*30)}' -nE'if(/^(\w+\s+\d+\s+\d+:\d+:\d+)/) {$t=str2time $1; $t > $old && $t < $now && print}' (1 Reply)
Discussion started by: learnbash
1 Replies

10. UNIX for Beginners Questions & Answers

Help with understanding this regex in a Perl script parsing a 'complex' string

Hi, I need some guidance with understanding this Perl script below. I am not the author of the script and the author has not leave any documentation. I supposed it is meant to be 'easy' if you're a Perl or regex guru. I am having problem understanding what regex to use :confused: The script does... (3 Replies)
Discussion started by: newbie_01
3 Replies
prototype(4)							   File Formats 						      prototype(4)

NAME
prototype - package information file DESCRIPTION
prototype is an ASCII file used to specify package information. Each entry in the file describes a single deliverable object. An object may be a data file, directory, source file, executable object, and so forth. This file is generated by the package developer. Entries in a prototype file consist of several fields of information separated by white space. Comment lines begin with a ``#'' and are ignored. The fields are described below and must appear in the order shown. part An optional field designating the part number in which the object resides. A part is a collection of files and is the atomic unit by which a package is processed. A developer can choose criteria for grouping files into a part (for example, based on class). If this field is not used, part 1 is assumed. ftype A one-character field that indicates the file type. Valid values are: b block special device c character special device d directory e a file to be edited upon installation or removal (may be shared by several packages) f a standard executable or data file i installation script or information file l linked file p named pipe s symbolic link v volatile file (one whose contents are expected to change, like a log file) x an exclusive directory accessible only by this package class The installation class to which the file belongs. This name must contain only alphanumeric characters and be no longer than 12 characters. The field is not specified for installation scripts. (admin and all classes beginning with capital letters are reserved class names.) pathname The pathname where the file will reside on the target machine, for example, /usr/bin/mail or bin/ras/proc. Relative path- names (those that do not begin with a slash) indicate that the file is relocatable. The form path1=path2 may be used for two purposes: to define a link and to define local pathnames. For linked files, path1 indicates the destination of the link and path2 indicates the source file. (This format is manda- tory for linked files.) For local pathnames, path1 indicates the pathname an object should have on the machine where the entry is to be installed and path2 indicates either a relative or fixed pathname to a file on the host machine which contains the actual contents. A pathname may contain a variable specification of the form $variable. If variable begins with a lower case letter, it is a build variable. If variable begins with an upper case letter, it is an install variable. Build variables are bound at build time. If an install variable is known at build time, its definition is inserted into the pkginfo(4) file so that it will be available at install time. If an install variable is not known at build time, it will be bound at install time. major The major device number. The field is only specified for block or character special devices. minor The minor device number. The field is only specified for block or character special devices. mode The octal mode of the file (for example, 0664). A question mark (?) indicates that the mode will be left unchanged, imply- ing that the file already exists on the target machine. This field is not used for linked files or packaging information files. The mode can be a variable specification of the form $variable. If variable begins with a lower case letter, it is a build variable. If variable begins with an upper case letter, it is an install variable. Build variables are bound at build time. If an install variable is known at build time, its definition is inserted into the pkginfo(4) file so that it will be available at install time. If an install variable is not known at build time, it will be bound at install time. owner The owner of the file (for example, bin or root). The field is limited to 14 characters in length. A question mark (?) indicates that the owner will be left unchanged, implying that the file already exists on the target machine. This field is not used for linked files or packaging information files. The owner can be a variable specification of the form $variable. If variable begins with a lower case letter, it is a build variable. If variable begins with an upper case letter, it is an install variable. Build variables are bound at build time. If an install variable is known at build time, its definition is inserted into the pkginfo(4) file so that it will be available at install time. If an install variable is not known at build time, it will be bound at install time. group The group to which the file belongs (for example, bin or sys). The field is limited to 14 characters in length. A question mark (?) indicates that the group will be left unchanged, implying that the file already exists on the target machine. This field is not used for linked files or packaging information files. The group can be a variable specification of the form $variable. If variable begins with a lower case letter, it is a build variable. If variable begins with an upper case letter, it is an install variable. Build variables are bound at build time. If an install variable is known at build time, its definition is inserted into the pkginfo(4) file so that it will be available at install time. If an install variable is not known at build time, it will be bound at install time. An exclamation point (!) at the beginning of a line indicates that the line contains a command. These commands are used to incorporate files in other directories, to locate objects on a host machine, and to set permanent defaults. The following commands are available: search Specifies a list of directories (separated by white space) to search for when looking for file contents on the host machine. The base name of the path field is appended to each directory in the ordered list until the file is located. Searches are not recursive. include Specifies a pathname which points to another prototype file to include. Note that search requests do not span include files. default Specifies a list of attributes (mode, owner, and group) to be used by default if attribute information is not provided for prototype entries which require the information. The defaults do not apply to entries in include prototype files. param=value Places the indicated parameter in the current environment. Spans to subsequent included prototype files. The above commands may have variable substitutions embedded within them, as demonstrated in the two example prototype files below. Before files are overwritten during installation, they are copied to a temporary pathname. The exception to this rule is files whose mode includes execute permission, unless the file is editable (that is, ftype is e). For files which meet this exception, the existing version is linked to a temporary pathname, and the original file is removed. This allows processes which are executing during installation to be overwritten. EXAMPLES
Example 1: Example 1: !PROJDIR=/usr/proj !BIN=$PROJDIR/bin !CFG=$PROJDIR/cfg !LIB=$PROJDIR/lib !HDRS=$PROJDIR/hdrs !search /usr/myname/usr/bin /usr/myname/src /usr/myname/hdrs i pkginfo=/usr/myname/wrap/pkginfo i depend=/usr/myname/wrap/depend i version=/usr/myname/wrap/version d none /usr/wrap 0755 root bin d none /usr/wrap/usr/bin 0755 root bin ! search $BIN f none /usr/wrap/bin/INSTALL 0755 root bin f none /usr/wrap/bin/REMOVE 0755 root bin f none /usr/wrap/bin/addpkg 0755 root bin !default 755 root bin f none /usr/wrap/bin/audit f none /usr/wrap/bin/listpkg f none /usr/wrap/bin/pkgmk # the following file starts out zero length but grows v none /usr/wrap/logfile=/dev/null 0644 root bin # the following specifies a link (dest=src) l none /usr/wrap/src/addpkg=/usr/wrap/bin/rmpkg ! search $SRC !default 644 root other f src /usr/wrap/src/INSTALL.sh f src /usr/wrap/src/REMOVE.sh f src /usr/wrap/src/addpkg.c f src /usr/wrap/src/audit.c f src /usr/wrap/src/listpkg.c f src /usr/wrap/src/pkgmk.c d none /usr/wrap/data 0755 root bin d none /usr/wrap/save 0755 root bin d none /usr/wrap/spool 0755 root bin d none /usr/wrap/tmp 0755 root bin d src /usr/wrap/src 0755 root bin Example 2: Example 2: # this prototype is generated by 'pkgproto' to refer # to all prototypes in my src directory !PROJDIR=/usr/dew/projx !include $PROJDIR/src/cmd/prototype !include $PROJDIR/src/cmd/audmerg/protofile !include $PROJDIR/src/lib/proto SEE ALSO
pkgmk(1), pkginfo(4) Application Packaging Developer's Guide NOTES
Normally, if a file is defined in the prototype file but does not exist, that file is created at the time of package installation. However, if the file pathname includes a directory that does not exist, the file will not be created. For example, if the prototype file has the following entry: f none /usr/dev/bin/command and that file does not exist, it will be created if the directory /usr/dev/bin already exists or if the prototype also has an entry defin- ing the directory: d none /usr/dev/bin SunOS 5.10 4 Oct 1996 prototype(4)
All times are GMT -4. The time now is 07:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy