Sponsored Content
Full Discussion: Perl - Posix macro
Top Forums Shell Programming and Scripting Perl - Posix macro Post 302359479 by NDxiak on Tuesday 6th of October 2009 04:58:48 PM
Old 10-06-2009
Perl - Posix macro

Hey Guys,

I'm trying to execute this ..

Code:
chdir "/Volumes/c/d" 
   or die "Wait for ...... then run script $!\n" ; 
 
for my $file (<Color.png>) 
  { my ($name,$path,$suffix) = fileparse($file,".png") ; 
    my $datestamp = strftime("_%m_%d",localtime) ; 
    copy $file,"/Volumes/1/2/$name$datestamp$suffix" 
      or warn "Cannot copy $file $!\n" ; 
   
 }

I'm getting error msg:

Your vendor has not defined POSIX macro SIGRTMIN, used at
../../lib/POSIX.pm (autosplit into ../../lib/auto/POSIX/SigRt/_init.al)
line 1000

system:

Apache/2.2.11 (Unix) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.7l PHP/5.2.9 mod_perl/2.0.4 Perl/v5.10.0

I did look around in POSIX.pm but I don't have any expedience with perl modules.

Thank u for help
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

VI Macro Problem

I'm having a problem with a macro i put in my .exrc file. Here's what I put: map #I ^[ ^ [ is control-v and the escape key. It places a # a the beginning of a line by simply hitting the # on the keyboard. Problem is, now when I hit "o" or "O" to move up or down a line, it places a # at... (1 Reply)
Discussion started by: Atama
1 Replies

2. HP-UX

USRSTACK macro

I'm upleveling code from 10.20 to 11.11....but I'm running into a problem in which the USRSTACK macro does not seem to be defined in 11.11. Has anybody else experienced this/fixed it/worked around it? Is there a different macro I should be using instead? Thanks for any info you can provide!! (1 Reply)
Discussion started by: jalburger
1 Replies

3. Programming

macro

Can i define a macro for a function of 10 LOC. (9 Replies)
Discussion started by: bankpro
9 Replies

4. Programming

Regarding #ident macro

Hi, In my application I have some number c files. In each of the file the following line will be the first statement. #ident "@(#) set.c 14.1.2.2 05/15/01 17:06:32" I would like to know what is the use of the above statement. Thanks Sarwan (1 Reply)
Discussion started by: sarwan
1 Replies

5. Programming

Make-question - redefine a macro, using another macro..?

I think there is no problem to use any macro in a new macro definishion, but I have a problem with that. I can not understand why? I have a *.mak file that inludes file with many definitions and rules. ############################################## include dstndflt.mak ... One of the... (2 Replies)
Discussion started by: alex_5161
2 Replies

6. UNIX for Dummies Questions & Answers

F-key macro...

Hi everyone, What I am trying to do is assign a F-key a macro to save a file in vi and display said file in firefox. The details are as follows: I am using a Win 7 laptop with and ssh program to log into a unix system. What I am trying to do is figure out how to bring up the firefox... (1 Reply)
Discussion started by: csharp100
1 Replies

7. UNIX for Dummies Questions & Answers

Basic Question on perl use POSIX [SOLVED]

Hi guys, I think this is a basic question. I'm not very familiar with this. I'm trying to round a number up and round a number down. From what I have read this can be done using POSIX. I have tried to to use this, but i'm getting errors: sub findGridBounds($$$%) { use POSIX; ... (0 Replies)
Discussion started by: WongSifu
0 Replies

8. UNIX for Dummies Questions & Answers

macro

Can I create a macro in UNIX? If so where do I find out how? (1 Reply)
Discussion started by: JD_Sal
1 Replies

9. UNIX for Dummies Questions & Answers

UNIX macro....Im new!!

Hey guys, thanks for lookin....my question is I want to create a macro on HPUX to SFTP a .xls to my Windows Server....I have exstensively searched and all I can find is What a macro is not how to create one. Reasoning for having a macro is to put it in a file creation script and have it run at... (7 Replies)
Discussion started by: DStewart
7 Replies

10. Shell Programming and Scripting

Convert posix regex to pcre (perl)

In order to clean file from html tags i used the following sed 's/<*>//g' filename Right now i need to do the same from php script so i have to use pcre. How to convert? (1 Reply)
Discussion started by: urello
1 Replies
File::Basename(3pm)					 Perl Programmers Reference Guide				       File::Basename(3pm)

NAME
File::Basename - Parse file paths into directory, filename and suffix. SYNOPSIS
use File::Basename; ($name,$path,$suffix) = fileparse($fullname,@suffixlist); $name = fileparse($fullname,@suffixlist); $basename = basename($fullname,@suffixlist); $dirname = dirname($fullname); DESCRIPTION
These routines allow you to parse file paths into their directory, filename and suffix. NOTE: "dirname()" and "basename()" emulate the behaviours, and quirks, of the shell and C functions of the same name. See each function's documentation for details. If your concern is just parsing paths it is safer to use File::Spec's "splitpath()" and "splitdir()" methods. It is guaranteed that # Where $path_separator is / for Unix, for Windows, etc... dirname($path) . $path_separator . basename($path); is equivalent to the original path for all systems but VMS. "fileparse" my($filename, $directories, $suffix) = fileparse($path); my($filename, $directories, $suffix) = fileparse($path, @suffixes); my $filename = fileparse($path, @suffixes); The "fileparse()" routine divides a file path into its $directories, $filename and (optionally) the filename $suffix. $directories contains everything up to and including the last directory separator in the $path including the volume (if applicable). The remainder of the $path is the $filename. # On Unix returns ("baz", "/foo/bar/", "") fileparse("/foo/bar/baz"); # On Windows returns ("baz", "C:fooar", "") fileparse("C:fooaraz"); # On Unix returns ("", "/foo/bar/baz/", "") fileparse("/foo/bar/baz/"); If @suffixes are given each element is a pattern (either a string or a "qr//") matched against the end of the $filename. The matching portion is removed and becomes the $suffix. # On Unix returns ("baz", "/foo/bar/", ".txt") fileparse("/foo/bar/baz.txt", qr/.[^.]*/); If type is non-Unix (see "fileparse_set_fstype()") then the pattern matching for suffix removal is performed case-insensitively, since those systems are not case-sensitive when opening existing files. You are guaranteed that "$directories . $filename . $suffix" will denote the same location as the original $path. "basename" my $filename = basename($path); my $filename = basename($path, @suffixes); This function is provided for compatibility with the Unix shell command basename(1). It does NOT always return the file name portion of a path as you might expect. To be safe, if you want the file name portion of a path use "fileparse()". "basename()" returns the last level of a filepath even if the last level is clearly directory. In effect, it is acting like "pop()" for paths. This differs from "fileparse()"'s behaviour. # Both return "bar" basename("/foo/bar"); basename("/foo/bar/"); @suffixes work as in "fileparse()" except all regex metacharacters are quoted. # These two function calls are equivalent. my $filename = basename("/foo/bar/baz.txt", ".txt"); my $filename = fileparse("/foo/bar/baz.txt", qr/Q.txtE/); Also note that in order to be compatible with the shell command, "basename()" does not strip off a suffix if it is identical to the remaining characters in the filename. "dirname" This function is provided for compatibility with the Unix shell command dirname(1) and has inherited some of its quirks. In spite of its name it does NOT always return the directory name as you might expect. To be safe, if you want the directory name of a path use "fileparse()". Only on VMS (where there is no ambiguity between the file and directory portions of a path) and AmigaOS (possibly due to an implementation quirk in this module) does "dirname()" work like "fileparse($path)", returning just the $directories. # On VMS and AmigaOS my $directories = dirname($path); When using Unix or MSDOS syntax this emulates the dirname(1) shell function which is subtly different from how "fileparse()" works. It returns all but the last level of a file path even if the last level is clearly a directory. In effect, it is not returning the directory portion but simply the path one level up acting like "chop()" for file paths. Also unlike "fileparse()", "dirname()" does not include a trailing slash on its returned path. # returns /foo/bar. fileparse() would return /foo/bar/ dirname("/foo/bar/baz"); # also returns /foo/bar despite the fact that baz is clearly a # directory. fileparse() would return /foo/bar/baz/ dirname("/foo/bar/baz/"); # returns '.'. fileparse() would return 'foo/' dirname("foo/"); Under VMS, if there is no directory information in the $path, then the current default device and directory is used. "fileparse_set_fstype" my $type = fileparse_set_fstype(); my $previous_type = fileparse_set_fstype($type); Normally File::Basename will assume a file path type native to your current operating system (ie. /foo/bar style on Unix, fooar on Windows, etc...). With this function you can override that assumption. Valid $types are "MacOS", "VMS", "AmigaOS", "OS2", "RISCOS", "MSWin32", "DOS" (also "MSDOS" for backwards bug compatibility), "Epoc" and "Unix" (all case-insensitive). If an unrecognized $type is given "Unix" will be assumed. If you've selected VMS syntax, and the file specification you pass to one of these routines contains a "/", they assume you are using Unix emulation and apply the Unix syntax rules instead, for that function call only. SEE ALSO
dirname(1), basename(1), File::Spec perl v5.12.1 2010-04-26 File::Basename(3pm)
All times are GMT -4. The time now is 09:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy