02-28-2012
@hemasid: I think the solution provided by Skrynesaver in post #2 fits your question. If not, what is it that you're exactly looking for?
if (($dir=~/latest/) && ( -d "$base/$dir")) --> This line decides if a file in "ABC/a/b/g" contains the string "latest" in it and is a directory.
It'll look for "final.html" in directories like "ABC/a/b/g/123_latest_hello/z/x/c/", "ABC/a/b/g/IMlatestDIR/z/x/c/", etc..
This User Gave Thanks to balajesuri For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hey all,
I've been trying to learn Perl on my BSD box. When it came to printing the files out, it bothered me that the lines weren't numbered. So here's my little *crap* claim to some-form-of-fame Perl script which numbers files:
... (9 Replies)
Discussion started by: WIntellect
9 Replies
2. Linux
Hi
I am having a file with 243 lines..
The file format s given below
eg
P25787 hsa03050 1 P20618 hsa03050 1
P25786 hsa03050 1 P49721 hsa03050 1
P54132 hsa03440 1 Q13472 hsa03470 1
Q05513 hsa04530 hsa04910 hsa04930 3 Q04759 ... (0 Replies)
Discussion started by: binnybio
0 Replies
3. Shell Programming and Scripting
I wish to write a Perl program that will provide a listing of files in a directory. The files must be listed in sorted order by the file name.
• By default, the program displays only file names.
• By default, the program lists the files in the current directory.
• The program must provide the... (2 Replies)
Discussion started by: livewire06
2 Replies
4. Shell Programming and Scripting
could i get any help with how to link this program together. i dont know what to put where the X's are
print `flush`;
thank(); #print thank header
use Getopt::Std; # use declaration with the options function
getopts("ld:") or usage() and exit; ... (3 Replies)
Discussion started by: livewire06
3 Replies
5. Homework & Coursework Questions
Long story short: I'm working inside of a Unix SSH under a bash shell. I have to code a C program that generates a random number. Then I have to call the compiled C program with a Perl program to run the C program 20 times and put all the generated random #s into a text file, then print that text... (1 Reply)
Discussion started by: jdkirby
1 Replies
6. Shell Programming and Scripting
how would you exit out of a programm correctly, without having for the program to crash?
for example
print "Enter quit";
$input = <STDIN>;
if ($input eq "quit")
{
{QUIT THE PROGRAM}
}
else
{
print "invalid input";
}
one more thing, how do u exit a program "correctly", if... (3 Replies)
Discussion started by: bshell_1214
3 Replies
7. Programming
Hi
I am new to perl, i need to write a program to convert horizontal words to vertical
eg: cat, dog, cow,.....(text file)
this should be written as
1.cat
2.dog
like this. can u pls help me to work out.. (4 Replies)
Discussion started by: nitha
4 Replies
8. Shell Programming and Scripting
hi,
i have posted the same kind of the question in some other forum of the same site. but realized that it is supposed to be here so i am reposting it .this is the perl script written to check for particular pattern.
my file 1 would look like this
hwk:678:9878:asd:09: abc cfgb 12 nmjk ......... (3 Replies)
Discussion started by: anurupa777
3 Replies
9. Shell Programming and Scripting
can anyone help me out to write a code by connecting to the sql database and I need to print the list of tables present in the databse.
any ideas please. (1 Reply)
Discussion started by: ramkumar15
1 Replies
10. Shell Programming and Scripting
I created a program, so a kid can practice there math on it. It dispenses varies math problems and the kid must input an answer. I also want it to grade the work they have done, but I can't find the best place for it to print out the grade.
I have:
if ( $response =~ m/^/ ) {
$user_wants_to_quit... (1 Reply)
Discussion started by: germany1517
1 Replies
chdir(2) System Calls Manual chdir(2)
NAME
chdir, fchdir - change working directory
SYNOPSIS
DESCRIPTION
and cause a directory pointed to by path or fildes to become the current working directory, the starting point for path searches of path
names not beginning with path points to the path name of a directory. fildes is an open file descriptor of a directory.
For a directory to become the current working directory, a process must have execute (search) access to the directory.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and is set to indicate the error.
ERRORS
fails and the current working directory remains unchanged if one or more of the following are true:
A component of the path name is not a directory.
The named directory does not exist.
Search permission is denied for any component of the path name.
path points outside the allocated address space of the process. The reliable detection of this error is implemen-
tation dependent.
path is null.
The length of the specified path name exceeds
bytes, or the length of a component of the path name exceeds bytes while is in effect.
Too many symbolic links were encountered in translating the path name.
fails and the current working directory remains unchanged if one or more of the following are true:
Search permission is denied for
fildes.
fildes is not an open file descriptor.
The open file descriptor
fildes does not refer to a directory.
AUTHOR
and were developed by AT&T Bell Laboratories and HP.
SEE ALSO
cd(1), chroot(2), privileges(5).
STANDARDS CONFORMANCE
chdir(2)