I have a question regarding running perl in the current process.
I shall demonstrate with an example.
Look at this.
sh-2.05b$ pwd
/tmp
sh-2.05b$ cat test.sh
#! /bin/sh
cd /etc
sh-2.05b$ ./test.sh
sh-2.05b$ pwd
/tmp
sh-2.05b$ . ./test.sh
sh-2.05b$ pwd
/etc
sh-2.05b$
So... (10 Replies)
List,
I want to print the first line of my text file (say "me you"), preceded by the current date/time.
Something like (pseudo code):
awk '{print date,$1}'
I don't have a lot of awk knowledge (understatement), so forgive me if the answer is obvious... (3 Replies)
Hi,
how can i print the previous, current and next line using sed?
current line is the matching line.
The following prints all lines containing 'Failure' and also the immediate next line
cat $file | sed -n -e '/Failure/{N;p;}'
Now, i also want to print the previous line too.
Thanks,... (8 Replies)
Hi All
I was wondering what is the most efficient way to find files in the current directory(that may contain 100,000's files), that meets a certain specified file type and of a certain age.
I have experimented with the find command in unix but it also searches all sub directories. I have... (2 Replies)
Hi All,
I am stuck with a problem and i want your help, what i want to do is
I have a directory name dircome
and there are 6 files present in this directory, the name of the files are d1,d2,d3,d4,d5,d6.
The Perl script print the files name, means the output should be
d1
d2
d3
d4
d5
d6 (9 Replies)
Hi all,
How do I print the name of my current working directory only to screen?
Not pwd!
For example, if I was in /home/work I am looking for 'work' only (4 Replies)
Dear All
I want below to compare two Consecutive line(i.e. current and next line). Based in that i need OP. Below is the IP file in that in i find "M" and if in next line i find "*" then i need both line in single line. If i dont find "*" in next line then i need to put commend "DOWN" .
I am... (4 Replies)
Heyas
I'm thinking about a new approach for my core display, basicly as it should make aligments easier.
Issue i'm currently facing, is tput cup capable of printing on the current line?
My best achievements were:
:) tui $ tput cup - 60;echo " ------ testing" ------ testing... (5 Replies)
Good evening
Need you help please
I just wanna to print out my current https connection and other users http connection which the application resides, for instance i connect to the below url to login into the application:
https://serverappp01:14100/portal/Portal.html#
In another session... (4 Replies)
Discussion started by: alexcol
4 Replies
LEARN ABOUT DEBIAN
file::spec::link
File::Spec::Link(3pm) User Contributed Perl Documentation File::Spec::Link(3pm)NAME
File::Spec::Link - Perl extension for reading and resolving symbolic links
SYNOPSIS
use File::Spec::Link;
my $file = File::Spec::Link->linked($link);
my $file = File::Spec::Link->resolve($link);
my $dirname = File::Spec::Link->chopfile($file);
my $newname = File::Spec::Link->relative_to_file($path, $link);
my $realname = File::Spec::Link->full_resolve($file);
my $realname = File::Spec::Link->resolve_path($file);
my $realname = File::Spec::Link->resolve_all($file);
DESCRIPTION
"File::Spec::Link" is an extension to "File::Spec", adding methods for resolving symbolic links; it was created to implement
"File::Copy::Link".
"linked($link)"
Returns the filename linked to by $link: by "readlink"ing $link, and resolving that path relative to the directory of $link.
"resolve($link)"
Returns the non-link ultimately linked to by $link, by repeatedly calling "linked". Returns "undef" if the link can not be resolved.
"chopfile($file)"
Returns the directory of $file, by splitting the path of $file and returning (the volumne and) directory parts.
"relative_to_file($path, $file)"
Returns the path of $path relative to the directory of file $file. If $path is absolute, just returns $path.
"resolve_all($file)"
Returns the filename of $file with all links in the path resolved, wihout using "Cwd".
"full_resolve($file)"
Returns the filename of $file with all links in the path resolved.
This sub tries to use "Cwd::abs_path" via "->resolve_path".
"resolve_path($file)"
Returns the filename of $file with all links in the path resolved.
This sub uses "Cwd::abs_path" and is independent of the rest of "File::Spec::Link".
Object methods
"new([$path])"
create new path object: stores path as a list
"path"
returns path as a string, using catpath
"canonical"
returns canonical path, using canonpath
"vol"
returns volume element of path, see File::Spec->splitpath
"dir"
returns directory element of path, as a string, see File::Spec->splitpath
"dirs"
return list of directory components in path, see File::Spec->splitdir
"pop"
remove last component of the path
"push($file)"
add a file component to the path, ignoring empty strings
"add($file)"
add a component to the path: treating "updir" as "pop", and ignoring "curdir" and empty strings
"split($path)"
populate a path object, using splitpath
"chop"
remove and return a file component from path, an empty string returns means this was root dir.
"relative($path)"
replace the path object with the supplied path, where the new path is relative to the path object
"follow"
follow the link, where the path object is a link
"resolved"
resolve the path object, by repeatedly following links
"resolvedir"
resolve the links at all component levels within the path object
Other class methods
"canonpath($path)"
Wrapper round File::Spec::canonpath, fatal if empty input
"catdir(@dirs)"
Wrapper round File::Spec::catdir, returns "curdir" from empty list
"splitlast($path)"
Get component from $path (using "chop") and returns remaining path and compenent, as strings. [Not used]
EXPORT
None - all subs are methods for "File::Spec::Link".
SEE ALSO File::Spec(3)File::Copy::Link(3)AUTHOR
Robin Barker, <Robin.Barker@npl.co.uk>
COPYRIGHT AND LICENSE
Copyright 2003, 2005, 2006, 2007 by Robin Barker
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.12.4 2011-09-30 File::Spec::Link(3pm)