Sponsored Content
Full Discussion: To read directories and file
Top Forums Shell Programming and Scripting To read directories and file Post 302540199 by rangarasan on Wednesday 20th of July 2011 02:52:04 AM
Old 07-20-2011
Tools Redirect files permision to a file

Code:
echo "File######User#####Permission" >File.txt;
echo "===============================================" >>File.txt;
ls -ltr | awk -F' ' '{if($1 == "total" ){}else{print $8"####"$1"####"$3;}}' >>File.txt

Cheers,
RangaSmilie

Moderator's Comments:
Mod Comment Please start using [CODE] tags when posting source listings, console output, ...

Last edited by pludi; 07-20-2011 at 04:45 AM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

read list of filenames from text file and remove these files in multiple directories

I have a large list of filenames from an Excel sheet, which I then translate into a simple text file. I'd like to use this list, which contains various file extensions , to archive these files and then remove them recursively through multiple directories and subdirectories. So far, it looks like... (5 Replies)
Discussion started by: fxvisions
5 Replies

2. Shell Programming and Scripting

Bash Script to Read & Write on different directories

Hi, root@server] df -h 121G 14G 101G 12% /home 147G 126G 14G 91% /backup We having our site files and images are storing in /backup/home/user/files/ through symbolic link created in /home directory pointing in /backup directory as following. root@server] cd /home... (1 Reply)
Discussion started by: mirfan
1 Replies

3. UNIX for Dummies Questions & Answers

Copy file into directories and sub-directories

Hello- I need to copy a file into multiple directories, and each directory's sub-directories (of which there are 5) Currently, the parent directory is set up like this: dir1 sub-dir1 sub-dir2 sub-dir3 sub-dir4 sub-dir5 dir2 sub-dir1 sub-dir2 sub-dir3 ... (1 Reply)
Discussion started by: penlok
1 Replies

4. Shell Programming and Scripting

Perl: Read directories and assign to array

I would like to read directories and assign to an array where the user can select a directory from the output. For example, a dir list will populate with a number assigned to each dir. I would like to ask the user to select the dir they want. TIA, I don't know what this would be called so I... (2 Replies)
Discussion started by: man
2 Replies

5. UNIX for Dummies Questions & Answers

When reading a csv file, counter to read 20 lines and wait for minute then read next 20 till end

Hello All, i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file. Any inputs are appreciated ... (3 Replies)
Discussion started by: victor.s
3 Replies

6. UNIX and Linux Applications

Perl Script to read an excel file into an array and search in the UNIX directories

Hi, I want the Perl script with versions 5.8.2 and 5.8.5 starting with #!/usr/bin/perl The Perl program should read the excel file or text file line by line and taking into an array and search in the UNIX directories for reference file of .jsp or .js or .xsl with path .The Object names... (2 Replies)
Discussion started by: pasam
2 Replies

7. Shell Programming and Scripting

Read directories sequential based on timestamp

Hi, I have a directory structure like below Directoryname create time d1 12:00 d2 12:05 d3 12:08 I want to read the directories based on timestamp.That is oldest directory must be read first and kick off certain process. ... (7 Replies)
Discussion started by: chetan.c
7 Replies

8. Shell Programming and Scripting

For loop and read from different directories

Hello, I need to grep/read files from multiple directories, one by one. I mean something like shuffling the cards uniformly. cd /directoryA for i in *.txt; do some codes cd ../directoryB for i in *.txt; do some codes cd ../directoryC for i in *.txt; do some codes done done... (8 Replies)
Discussion started by: baris35
8 Replies

9. Solaris

Giving read write permission to user for specific directories and sub directories.

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. This is for Solaris. Please help. (1 Reply)
Discussion started by: blinkingdan
1 Replies
File::Slurp::WithinPolicy(3pm)				User Contributed Perl Documentation			    File::Slurp::WithinPolicy(3pm)

NAME
File::Slurp::WithinPolicy - Applies filesystem policies to File::Slurp SYNOPSIS
use File::Slurp::WithinPolicy qw(:all); my $text = read_file( 'filename' ); my @lines = read_file( 'filename' ); write_file( 'filename', $text ); append_file( 'filename', $more_text ); overwrite_file( 'filename', $text ); my @files = read_dir( '/path/to/dir' ); DESCRIPTION
This provides the File::Slurp interface within a policy defined by File::Policy. By default, File::Policy is a no-op and this behaves identically to File::Slurp. System administrators may want to override the default File::Policy implementation to enforce a local filesys- tem policy (see File::Policy). FUNCTIONS
read_dir See "read_dir" in File::Slurp read_file See "read_file" in File::Slurp write_file See "write_file" in File::Slurp append_file See "append_file" in File::Slurp overwrite_file See "overwrite_file" in File::Slurp EXPORTS
By default, nothing is exported. The ":all" tag can be used to export everything. Individual methods can also be exported. SEE ALSO
File::Slurp, File::Policy VERSION
$Revision: 1.4 $ on $Date: 2005/06/15 10:40:21 $ by $Author: simonf $ AUTHOR
John Alden <cpan _at_ bbc _dot_ co _dot_ uk> COPYRIGHT
(c) BBC 2005. This program is free software; you can redistribute it and/or modify it under the GNU GPL. See the file COPYING in this distribution, or http://www.gnu.org/licenses/gpl.txt perl v5.8.8 2005-06-15 File::Slurp::WithinPolicy(3pm)
All times are GMT -4. The time now is 01:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy