Sponsored Content
Full Discussion: Doubt
Top Forums UNIX for Dummies Questions & Answers Doubt Post 302474486 by penchal_boddu on Wednesday 24th of November 2010 10:58:50 AM
Old 11-24-2010
Thank to Scott and Harsha !!!
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

One doubt

Hi, Can i use the shell script like this? When i am running the script it is hanging not giving me any output. I can redirect the output and then i can do the manipulations also but why this one is wrong. I am confused we can do like this or not.. #!/usr/bin/ksh for line in `top` do... (2 Replies)
Discussion started by: namishtiwari
2 Replies

2. UNIX for Advanced & Expert Users

doubt in df -h

in my parition i hav parition like this Filesystem Size Used Avail Use% Mounted on /dev/sda2 24G 22G 756M 97% / /dev/sda5 248G 1.2G 234G 1% /else /dev/sda1 965M 24M 892M 3% /boot tmpfs 7.0G 0 7.0G 0%... (1 Reply)
Discussion started by: ponmuthu
1 Replies

3. Shell Programming and Scripting

Doubt

Hi, I have a file with multiple entries and I have calculated the percentages. Now I want to know how many of my entries are there between 1-10% 11-20% and so on.. chr1_14401_14450 0.211954217888936 chr1_14451_14500 1.90758796100042 chr1_14501_14550 4.02713013988978... (1 Reply)
Discussion started by: Diya123
1 Replies

4. Ubuntu

Doubt

hi ,, i am new for this.. i want to know abt linux os.. which version is best for it industry.. please suggest me..:cool: (1 Reply)
Discussion started by: c vignesh kumar
1 Replies

5. Red Hat

Doubt

How to create a file with specific size in RHEL6 (1 Reply)
Discussion started by: Sashi Kanth A
1 Replies

6. Shell Programming and Scripting

Doubt..

Hi experts, In one of our code we have used some command like this. name=${name##*/} Can someone please let me know what exactly it does? Thanks & Regards, Sathya V. (1 Reply)
Discussion started by: Sathya83aa
1 Replies

7. UNIX for Beginners Questions & Answers

Doubt

in my shell script requirement is to search and replace the file with variable so i use the following command sed -i "s/abc/$SCHEMA/g" table.sql later when the script runs sqlplus username/pwd@Table& this & is not letting the variable to replace the value inside the file .please let me know... (1 Reply)
Discussion started by: bhuvan1
1 Replies
Dirent(3pm)						User Contributed Perl Documentation					       Dirent(3pm)

NAME
IO::Dirent - Access to dirent structs returned by readdir SYNOPSIS
use IO::Dirent; ## slurp-style opendir DIR, "/usr/local/foo"; my @entries = readdirent(DIR); closedir DIR; print $entries[0]->{name}, " "; print $entries[0]->{type}, " "; print $entries[0]->{inode}, " "; ## using the enumerator opendir DIR, "/etc"; while( my $entry = nextdirent(DIR) ) { print $entry->{name} . " "; } closedir DIR; DESCRIPTION
readdirent returns a list of hashrefs. Each hashref contains the name of the directory entry, its inode for the filesystem it resides on and its type (if available). If the file type or inode are not available, it won't be there! nextdirent returns the next dirent as a hashref, allowing you to iterate over directory entries one by one. This may be helpful in low- memory situations or where you have enormous directories. IO::Dirent exports the following symbols by default: readdirent nextdirent The following tags may be exported to your namespace: ALL which includes readdirent, nextdirent and the following symbols: DT_UNKNOWN DT_FIFO DT_CHR DT_DIR DT_BLK DT_REG DT_LNK DT_SOCK DT_WHT These symbols can be used to test the file type returned by readdirent in the following manner: for my $entry ( readdirent(DIR) ) { next unless $entry->{'type'} == DT_LNK; print $entry->{'name'} . " is a symbolic link. "; } For platforms that do not implement file type in its dirent struct, readdirent will return a hashref with a single key/value of 'name' and the filename (effectively the same as readdir). This is subject to change, if I can implement some of the to do items below. CAVEATS
This was written on FreeBSD and OS X which implement a robust (but somewhat non-standard) dirent struct and which includes a file type entry. I have plans to make this module more portable and useful by doing a stat on each directory entry to find the file type and inode number when the dirent.h does not implement it otherwise. Improvements and additional ports are welcome. TO DO
o For platforms that do not implement a dirent struct with file type, do a stat on the entry and populate the structure anyway. o Do some memory profiling (I'm not sure if I have any leaks or not). COPYRIGHT
Copyright 2002, 2011 Scott Wiersdorf. This library is free software; you can redistribute it and/or modify it under the terms of the Perl Artistic License. AUTHOR
Scott Wiersdorf, <scott@perlcode.org> ACKNOWLEDGEMENTS
Thanks to Nick Ing-Simmons for his help on the perl-xs mailing list. SEE ALSO
dirent(5), perlxstut, perlxs, perlguts, perlapi COPYRIGHT AND LICENSE
Copyright (C) 2007 by Scott Wiersdorf This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.1 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2011-08-22 Dirent(3pm)
All times are GMT -4. The time now is 07:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy