Sponsored Content
Top Forums Shell Programming and Scripting parsing output from ls command Post 302073132 by ajaya on Wednesday 10th of May 2006 10:08:59 AM
Old 05-10-2006
firt I have to find the directory in a directory

ls -ld */ will do it

once I find it is directory, I have to check the first 3 character of the directory

drwxr-xr-x 2 mqm mqm 512 Jan 20 09:36 DQAT001/
drwxr-xr-x 3 mqm mqm 512 Jan 25 12:38 DQAT004/
drwxr-xr-x 2 mqm mqm 512 Apr 20 07:55 DQAT0040/
drwxr-xr-x 2 mqm mqm 512 Apr 20 10:31 DQAT0041/
drwxr-xr-x 2 mqm mqm 512 Jul 13 2005 DQAT005/
drwxr-xr-x 2 mqm mqm 512 May 2 09:33 DQBT007/

in the above I have to find certain directory which has first three character say ' DQA'

how i can check the first three character in the "DQAT001/"

i hope you understand
thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

parsing output from a diff command...

hi, i have a script which pipes the output of a diff -rq command into a separate file/ it would read something like this: Files mod1/lala/xml/test1.txt and mod2/lala/xml/test1.txt differ Only in mod2/lala/xml: test2.txt What i need to do is to parse this file so i end up with just a... (5 Replies)
Discussion started by: kam
5 Replies

2. Shell Programming and Scripting

parsing output

I have a file that contains the output of the ls -iR command, something like this: ./results: 2504641011 result_1410 2500957642 result_525 2504641012 result_1425 2500957643 result_540 ./tests/1: 2500788755 1 2500788743 1000 ./tests/2: 2500788759 3 2500788758 999 ... (6 Replies)
Discussion started by: looza
6 Replies

3. Shell Programming and Scripting

Parsing output

I need to parse the following out put and determine if the USB is a DISK and whether or not it's External. If an HBA line contains "USB" then does the next line contain "DISK" and "External". 0:0,31,0: HBA : (aacraid,1) AAC SCSI 0,0,0: DISK : Adaptec ASR4800SAS Volu0001 ... (6 Replies)
Discussion started by: lochraven
6 Replies

4. Shell Programming and Scripting

parsing output of system()

Hi, From the above output of df command I need to parse only 43G (available space) and display it. root@localhost:> df -h /vol1/joy Filesystem Size Used Avail Capacity Mounted on /vol1/joy 180G 137G 43G 76% ... (3 Replies)
Discussion started by: cjjoy
3 Replies

5. Shell Programming and Scripting

Parsing dynamic data from a command output

Hi people, I am writing a korn shell script, and one of the command gives an output something like below: release.label.2010.03.02 objects: /project/path/to/some/file_name.ksh /project/path/another/file_name01.dat I have to retrieve the file paths one by one & use them as... (9 Replies)
Discussion started by: kiwin1000
9 Replies

6. Shell Programming and Scripting

parsing ifconfig output

I'm trying to gather information on the interfaces on a large number of servers. If I run ifconfig I will get: eth0 Link encap:Ethernet HWaddr 00:50:56:A2:27:C1 inet addr:10.145.xxx.xxx Bcast:10.152.45.255 Mask:255.255.254.0 ----- eth1 Link... (2 Replies)
Discussion started by: C0ppert0p
2 Replies

7. Shell Programming and Scripting

Parsing the date output

Hi fellows, I need to define a notification for SSL certificate expiration. My Command output is below: (this is the "Expiration Date") Tue Mar 15 09:30:01 2012 So, at 15th Feb (1 month before the expiration), a notification has to be triggered by a script or sth else. How can i set an... (5 Replies)
Discussion started by: oduth
5 Replies

8. Shell Programming and Scripting

parsing output

Can somebody provide a solution to parse the following; cat /tmp/xxx Name: QUE_REQU (o.mtaseast-o.dmart) (MTPost queue) Number of messages: 66446 (Age 686 min; Size 214 mb) Backlog (messages): 0 (Age 0 min) Name: QUE_REQU... (6 Replies)
Discussion started by: BeefStu
6 Replies

9. Shell Programming and Scripting

Parsing fields from class list files to use output with newusers command

Hello I am trying to develop a shell script that takes a text file such as this... E-mail@ Soc.Sec.No. *--------Name-----------* Class *School.Curriculum.Major.* Campus.Phone JCC2380 XXX-XX-XXXX CAREY, JULIE C JR-II BISS CPSC BS INFO TECH 412/779-9445 JAC1936 XXX-XX-XXXX... (7 Replies)
Discussion started by: crimputt
7 Replies

10. Shell Programming and Scripting

Parsing of TOP output

Hi , i am trying to set up an alert, when CPU usage (0.2%us in below output) is more than 40% top | head | grep '^Cpu' Cpu(s): 0.2%us, 0.2%sy, 0.0%ni, 99.1%id, 0.6%wa, 0.0%hi, 0.0%si, 0.0%st using CUT, i pulled the value 0.2 and assigned to CPU (variable) CPU=$(expr `top | head -10... (5 Replies)
Discussion started by: Prateek007
5 Replies
FACE(6) 							   Games Manual 							   FACE(6)

NAME
face - face files DESCRIPTION
The directory /lib/face contains a hierarchy of images of people. In that directory are subdirectories named by the sizes of the corre- sponding image files: 48x48x1 (48 by 48 pixels, one bit per pixel); 48x48x2 (48 by 48 pixels, two bits per pixel); 512x512x8 (512 by 512 pixels, eight bits per pixel); 512x512x24 (512 by 512 pixels, twenty-four bits per pixel (3 times 8 bits per color)). The large files serve no special purpose; they are stored either as bitmaps (see bitmap(6)) or as picture files (see picfile(9.6). The small files are the `icons' displayed by seemail (see mail(1)); their format is special. Icons are stored as text, one line of the file to one scan line of display. Each line is divided into 8-bit, 16-bit, or 32-bit big-endian words, stored as a list of comma-separated hexadecimal C constants, such as: 0x9200, 0x1bb0, 0x003e, This odd format is historical and the programs that read it are somewhat forgiving about blanks and the need for commas. The files /lib/face/*/.dict hold a correspondence between users at machines and face files. The format is machine/user directory/file.ver The machine is the domain name of the machine sending the message, and user the name of the user sending it, as recorded in /sys/log/mail. The directory is a further subdirectory of (say) /lib/face/48x48x1, named by a single letter corresponding to the first character of the user names. The file is the name of the file, typically but not always the user name, and ver is a number to distinguish different images, for example to distinguish the image for Bill Gates from the image for Bill Joy, both of which might otherwise be called b/bill. For exam- ple, Bill Gates might be represented by the line microsoft.com/bill b/bill.1 If multiple entries exist for a user in the various .dict files, seemail chooses the highest pixel size less than or equal to that of the display on which it is running. Finally, or rather firstly, the file /lib/face/.machinelist contains a list of machine/domain pairs, one per line, to map any of a set of machines to a single domain name to be looked up in the .dict files. The machine name may be a regular expression, so for example the entry .*research.att.com astro maps any of the machines in AT&T Research into the shorthand name astro, which then appears as a domain name in the .dict files. SEE ALSO
mail(1), tweak(1), bitmap(6) FACE(6)
All times are GMT -4. The time now is 08:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy