Sponsored Content
Top Forums Shell Programming and Scripting Store the files details in different file using bash Post 302506343 by anishkumarv on Sunday 20th of March 2011 06:21:17 AM
Old 03-20-2011
Store the files details in different file using bash

Hi all,

this is output of ls command !!

there is differen different files permission are there , and my requirement is each file permission is stored in different different file.
Code:
rwxr-xr-x  1 root root       0 Mar 29  2011 2
-rwxr-xr-x  1 root root       0 Mar 29  2011 20
drwxr-xr-x  2 root root    4096 Mar 16 23:12 a
-rwxr-xr-x  1 root root    1050 Mar 16 08:06 anaconda-ks.cfg
drwxr-xr-x  2 root root    4096 Mar 29  2011 anish
drwxr-xr-x  2 root root    4096 Mar 19 05:36 av
-rw-r--r--  1 root root  854994 Oct 25 18:39 boss.tgz
drwxr-xr-x  2 root root    4096 Mar 16 23:12 c
drwxr-xr-x  6 root root    4096 Mar 25  2011 del
drwxr-xr-x  6 root root    4096 Mar 20 14:59 Desktop
-rwxr-xr-x  1 root root 1141195 Mar  9 15:27 disketa-tim.tgz
-rwxr-xr-x  1 root root       0 Jan 16 00:00 dummy
drwxr-xr-x  2 root root    4096 Mar 16 23:12 e
drwxr-xr-x  2 root root    4096 Mar 17 00:10 flo
-rwxr-xr-x  1 root root      54 Mar 20 15:35 for.sh
drwxr-xr-x  2 root root    4096 Mar 16 23:12 gfg
-rwxr-xr-x  1 root root   30632 Mar 16 08:06 install.log
-rwxr-xr-x  1 root root    4492 Mar 16 08:03 install.log.syslog
-rw-r--r--  1 root root       0 Mar 19 23:16 logfile.txt
-rw-r--r--  1 root root       0 Mar 20 15:37 ls.txt
-rw-------  1 root root   17215 Mar 20 01:38 mbox
drwxr-xr-x  2 root root    4096 Mar 20 15:09 scripts
-rwxr-xr-x  1 root root   38946 Mar 16 08:12 scsconfig.log
-rwxr-xr-x  1 root root     195 Mar 16 08:12 scsrun.log
drwxr-xr-x 20 root root    4096 Mar 18 08:01 uat
drwxr-xr-x  2 root root    4096 Mar 16 23:12 w1


like this.

Code:
output :

file 1:
rwxr-xr-x  1 root root       0 Mar 29  2011 2


file 2:
drwxr-xr-x  2 root root    4096 Mar 16 23:12 e
drwxr-xr-x  2 root root    4096 Mar 17 00:10 flo
drwxr-xr-x  2 root root    4096 Mar 16 23:12 c
drwxr-xr-x  6 root root    4096 Mar 25  2011 del


file 3:

-rwxr-xr-x  1 root root   38946 Mar 16 08:12 scsconfig.log
-rwxr-xr-x  1 root root     195 Mar 16 08:12 scsrun.log

file 4:

-rw-------  1 root root   17215 Mar 20 01:38 mbox

file 5:

-rw-r--r--  1 root root       0 Mar 19 23:16 logfile.txt
-rw-r--r--  1 root root       0 Mar 20 15:37 ls.txt


how is it possible using shell scripting , please guide me


With Regards
Anish Kumar.V

Last edited by Scott; 03-20-2011 at 07:37 AM.. Reason: Replace Quote tags with Code tags
 

10 More Discussions You Might Find Interesting

1. Web Development

store images into databases or path to file system files ?

hi, I need a quick information about storing images into mysql databases. Is more convenient to store a path to the filesystem folder in which the images are stored, or is possible to directly store the images into my tables ? thanks (2 Replies)
Discussion started by: aneuryzma
2 Replies

2. Shell Programming and Scripting

Most reliable way to store file contents in an array in bash

Hi Guys, I have a file which has numbers in it separated by newlines as follows: 1.113 1.456 0.556 0.021 -0.541 -0.444 I am using the following code to store these in an array in bash: FILE14=data.txt ARRAY14=(`awk '{print}' $FILE14`) (6 Replies)
Discussion started by: npatwardhan
6 Replies

3. Shell Programming and Scripting

Find diff bet 2 files and store result in another file

Hi I want to compare 2 files. The files have the same amount of rows and columns. So each line must be compare against the other and if one differs from the other, the result of both must be stored in a seperate file. I am doing this in awk. Here is my file1: Blocks... (2 Replies)
Discussion started by: ladyAnne
2 Replies

4. Shell Programming and Scripting

to read two files, search for patterns and store the output in third file

hello i have two files temp.txt and temp_unique.text the second file consists the unique fields from the temp.txt file the strings stored are in the following form 4,4 17,12 15,65 4,4 14,41 15,65 65,89 1254,1298i'm able to run the following script to get the total count of a... (3 Replies)
Discussion started by: vaibhavkorde
3 Replies

5. UNIX for Dummies Questions & Answers

at -l doesnt give details of the scheduled job. How to get the details?

I have scheduled couple of shell scripts to run using 'at' command. The o/p of at -l is: $ at -l 1320904800.a Thu Nov 10 01:00:00 2011 1320894000.a Wed Nov 9 22:00:00 2011 1320876000.a Wed Nov 9 17:00:00 2011 $ uname -a SunOS dc2prcrptetl2 5.9 Generic_122300-54 sun4u sparc... (2 Replies)
Discussion started by: superparticle
2 Replies

6. Shell Programming and Scripting

Execute sequential files and store data in single file

1)In a particualr path i have a set of inputfiles like path:/defaultmis/MonthlyLoads/INFA_EXPORT_022013/map* example: 1)map_de 2)map_cod 3)map_feg ........and so on in above path there wil be nearly 15 to 20 files starting with map and in other path i have another file input file... (4 Replies)
Discussion started by: katakamvivek
4 Replies

7. Shell Programming and Scripting

Call a Perl script within a bash script and store the ouput in a .txt file

I'm attempting to write a bash script that will create a network between virtual machines. It accepts three arguments: an RSpec that describes the network topology, and two list of machines (servers and clients). I have a (working) Perl script that I want to call. This Perl script takes an RSpec... (6 Replies)
Discussion started by: mecaka
6 Replies

8. Shell Programming and Scripting

Store filenames for wget in bash

I have a bash that downloads a list of files as a text file using wget. What I now need to do is store those files names and pass them to a download call also using wget. List.txt in /home directory FilterDuplicates.html file1.bam file2.bam file3.bam file1.vcf.gz file2.vcf.gz... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. Shell Programming and Scripting

Bash to store result in variable for other lines in script to use

I can not figure out how to capture the $filename variable store by the bash. #!/bin/bash # oldest folder stored as variable for analysis, version log created, and quality indicators matched to run dir=/home/cmccabe/Desktop/NGS/test find "$dir" -maxdepth 1 -mindepth 1 -type d -printf... (5 Replies)
Discussion started by: cmccabe
5 Replies

10. Shell Programming and Scripting

Bash to match and store line as variable

The bash below loops through a specific directory dir and finds and writes the oldest folder to a variable called $filename. #!/bin/bash # oldest folder stored as variable for analysis, version log created, and quality indicators matched to run dir=/home/cmccabe/Desktop/NGS/test find... (2 Replies)
Discussion started by: cmccabe
2 Replies
fdmns(4)						     Kernel Interfaces Manual							  fdmns(4)

NAME
fdmns - contains file domain names and devices DESCRIPTION
The fdmns directory ensures access to file domains by providing symbolic links to every volume in the file domain. The mkfdmn, rmvol, and addvol utilities automatically manage the fdmns directory. Each file domain is described by its own subdirectory within the fdmns direc- tory. Back up the fdmns directory structure regularly using the vdump utility or any other backup utility (dump, tar, cpio). If the contents of the fdmns directory are deleted or corrupted, restore the directory from your most recent backup tape. You must also restore the fdmns directory after installing a new version of the operating system. Always keep a hardcopy record of each file domain and its associated volumes in case a backup copy of the fdmns directory is unavailable. If you have a record, you can reconstruct the fdmns directory structure. The following is a sample fdmns directory: total 2 drwxr-x--- 2 root system 512 Nov 24 18:35 scratch/ drwxr-xr-x 2 root system 512 Nov 24 18:35 usr/ ./scratch: total 0 lrwxr-x--- 1 root system 10 Oct 23 15:13 dsk10c@ -> /dev/disk/dsk10c lrwxr-x--- 1 root system 10 Oct 24 11:33 dsk11c@ -> /dev/disk/dsk11c lrwxr-x--- 1 root system 9 Oct 13 18:29 dsk8c@ -> /dev/disk/dsk8c ./usr: total 0 lrwxr-x--- 1 root system 9 Oct 24 10:52 dsk2g@ -> /dev/disk/dsk2c lrwxr-x--- 1 root system 9 Nov 24 10:35 dsk9c@ -> /dev/disk/dsk9c RESTRICTIONS
Do not remove or modify the contents of this directory. If the fdmns file becomes corrupted, you can no longer access (or mount) any file- set in the file domains. SEE ALSO
advfs(4), vdump(8), mkfdmn(8), vrestore(8), showfdmn(8) fdmns(4)
All times are GMT -4. The time now is 06:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy