Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Combining resukts of ls commands Post 302363943 by dsrookie on Wednesday 21st of October 2009 04:30:32 PM
Old 10-21-2009
Thanks All. I could get the result when I ran it on command prompt.

But I have another problem.

So assume that I get 2 files EmpCNTDelta_timestamp.xml and EmpCNTFull_timestamp.xml

I put

ls Emp*Delta*.xml Emp*Full*.xml

This command in my ETL tool failed as as there was no Delta Xml present in Dir (it would be either Delta or Full or both)

I know we can use something like [Delta|Full] kind of thing in unix and give just one argument to the ls command.

Can someone help me in creating that

something like.......but i doesnt work Smilie

ls Emp*[Full|Delta]*.xml

Thanks

---------- Post updated at 03:30 PM ---------- Previous update was at 03:23 PM ----------

Thanks All. I could get the result when I ran it on command prompt.

But I have another problem.

So assume that I get 2 files EmpCNTDelta_timestamp.xml and EmpCNTFull_timestamp.xml

I put

ls Emp*Delta*.xml Emp*Full*.xml

This command in my ETL tool failed as as there was no Delta Xml present in Dir (it would be either Delta or Full or both)

I know we can use something like [Delta|Full] kind of thing in unix and give just one argument to the ls command.

Can someone help me in creating that

something like.......but i doesnt work Smilie

ls Emp*[Full|Delta]*.xml

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Combining elements of different commands in history

What is the correct format for a single command that would combine portions of 2 different lines in the command history? I'm using a C shell. Here's a simplified command history to clarify: 4 rm file1 5 ls -ld file2 file3 file4 6 cat file 5 With the above history, what would be the... (5 Replies)
Discussion started by: Dbyte
5 Replies

2. Shell Programming and Scripting

combining unix commands and awk program

Dear Experts I am trying to find if it is possible to combine unix commands in awk program. For example if it is possible embed rm or ls or any unix command inside the awk program and while it is reading the file besides printing be able to do some unix commands. I am thinking may be just print... (2 Replies)
Discussion started by: Reza Nazarian
2 Replies

3. UNIX for Dummies Questions & Answers

combining sed commands

I would like to change the lines: originalline1 originalline2 to: originalline1new originalline1newline originalline2new originalline2newline To do this, id like to combine the commands: sed 's/^/&new/g' file > newfile1 and sed '/^/ a\\ newline\\ \\ (2 Replies)
Discussion started by: Dave724001
2 Replies

4. UNIX for Dummies Questions & Answers

combining commands

Hello all, I am trying to list and count all the files of a particular type in any given directory. I can use the commands separately but when I combine them they do not give an output. The command for counting the files is ls -1 | wc -l and for listing all the file of particular type say... (2 Replies)
Discussion started by: BigTool4u2
2 Replies

5. UNIX for Advanced & Expert Users

Combining two commands.

Is there anyway to achieve "find /home -name "*.bashrc" 2>/dev/null" and "PS1="\n>"" in the same command? I just wanna add a line to the previous command to change the PS1 variable to ">". (1 Reply)
Discussion started by: raidkridley
1 Replies

6. Shell Programming and Scripting

Combining multiple commands

Hi Guys, I am looking to optimze these 5 SSH lines to a single SSH to get my machine to not hang! lol! cat hosts.lst | xargs -n1 -t -i echo 'home/util/timeout 6 0 ssh -q {} top -b > util/{}.top &' >> r_query_info cat hosts.lst | xargs -n1 -t -i echo 'home/util/timeout 6 0 ssh -q {} uname -r... (5 Replies)
Discussion started by: wick3dsunny
5 Replies

7. UNIX for Dummies Questions & Answers

Combining two commands that use sar.

hey can anyone tell me how can i combine these two commands so that it is executed only once, but gives me both the results. IDLE=`sar 30 6 | grep Average | awk '{print $1 $5}' ` sar 30 120 | awk '{print $1" "$5}' >> mailx -m -s "$MSG" xyz@abc.com. (5 Replies)
Discussion started by: Ankur Khatri
5 Replies

8. UNIX for Dummies Questions & Answers

Help with combining the ls and 'file' commands

I have a directory of 3000 files without extensions (Solaris 5.10). I would like to iterate the file names through the 'file' command and output their mime types (most are pdf or jpg, but a very few might be psd or swf which show simply as 'data') So, I would like the output of the 'ls'... (2 Replies)
Discussion started by: pwallace
2 Replies

9. Shell Programming and Scripting

How to combining awk commands?

I can achieve two tasks with 2 different awk commands: 1) awk -F";;WORD" '{print $2}' file | sed '/^$/d' #to find surface_word 2) awk -F"bw:|gloss:" '// {print $2}' file | sed '/\//!d; s:/*+*: + :g; s:^+::; s: *+ *$::;' #to find segmentation of surface_word Number 1) finds surface_word... (7 Replies)
Discussion started by: Viernes
7 Replies

10. Shell Programming and Scripting

Combining 2 commands

Hello all, I need to send an attachment and text in the body, both in the same Email. Below are two cammand that send the required data in separate Emails. I need to combine them so that I get just 1 Email containing the attachment & text in the body. uuencode ${filename} "${file_}" |... (6 Replies)
Discussion started by: Junaid Subhani
6 Replies
prs(1)							      General Commands Manual							    prs(1)

Name
       prs - display information from an SCCS file

Syntax
       prs [-d[dataspec]] [-r[SID]] [-e] [-l] [-a] files

Description
       The command prints on the standard output all or parts of an SCCS file in a user supplied format.  For further information, see If a direc-
       tory is named, behaves as though each file in the directory were specified as a named file, except that non-SCCS files (last  component	of
       the  path  name	does  not begin with s.), and unreadable files are silently ignored.  If a name of - is given, the standard input is read;
       each line of the standard input is taken to be the name of an SCCS file or directory to be processed; non-SCCS files and  unreadable  files
       are silently ignored.

       Arguments to which may appear in any order, consist of keyletter arguments, and file names.

Options
       All the described keyletter arguments apply independently to each named file:

       -a		   Displays printing of information for both removed and existing deltas.  For example, removed delta type = R, and exist-
			   ing delta type = D.	For further information, see If the -a keyletter is not specified, information	is  provided  only
			   for existing deltas.

       -d[dataspec]	   Displays  information  specified by dataspec.  The dataspec is a string consisting of SCCS file data keywords (see DATA
			   KEYWORDS) interspersed with optional user-supplied text.

       -e		   Displays information for all deltas created earlier than and including the delta designated by the -r keyletter.

       -l		   Displays information for all deltas created later than and including the delta designated by the -r keyletter.

       -r[SID]		   Indicates delta version number.  If no SID is specified, the SID of the most recently created delta is assumed.

Data Keywords
       Data keywords specify which parts of an SCCS file are to be retrieved and printed on the standard output.  All parts of an SCCS	file  have
       an associated data keyword.  For further information, see There is no limit on the number of times a data keyword may appear in a dataspec.

       The information printed by consists of the user supplied text and the appropriate values (extracted from the SCCS file) substituted for the
       recognized data keywords in the order of appearance in the dataspec.  The format of a data keyword value is either  Simple  (S),  in  which
       keyword substitution is direct, or Multi-line (M), in which keyword substitution is followed by a carriage return.

       User  supplied text is any text other than recognized data keywords.  A tab is specified by 	 and carriage return/new-line is specified by
       
.

							Table 1. SCCS Files Data Keywords
			      Keyword Data Item 			      File Section	 Value	     Format
			       :Dt:   Delta Information 		      Delta Table     See below*       S
			       :DL:   Delta line statistics			  "	    :Li:/:Ld:/:Lu:     S
			       :Li:   Lines inserted by Delta			  "		 nnnnn	       S
			       :Ld:   Lines deleted by Delta			  "		 nnnnn	       S
			       :Lu:   Lines unchanged by Delta			  "		 nnnnn	       S
			       :DT:   Delta type				  "		D or R	       S
			       :I:    SCCS ID string (SID)			  "	    :R:.:L:.:B:.:S:    S
			       :R:    Release number				  "		 nnnn	       S
			       :L:    Level number				  "		 nnnn	       S
			       :B:    Branch number				  "		 nnnn	       S
			       :S:    Sequence number				  "		 nnnn	       S
			       :D:    Date Delta created			  "	    :Dy:/:Dm:/:Dd:     S
			       :Dy:   Year Delta created			  "		  nn	       S
			       :Dm:   Month Delta created			  "		  nn	       S
			       :Dd:   Day Delta created 			  "		  nn	       S
			       :T:    Time Delta created			  "	    :Th:::Tm:::Ts:     S
			       :Th:   Hour Delta created			  "		  nn	       S

			       :Tm:   Minutes Delta created			  "		  nn	       S
			       :Ts:   Seconds Delta created			  "		  nn	       S
			       :P:    Programmer who created Delta		  "		logname        S
			       :DS:   Delta sequence number			  "		 nnnn	       S
			       :DP:   Predecessor Delta seq-no. 		  "		 nnnn	       S
			       :DI:   Seq-no. of deltas incl., excl., ignored	  "	    :Dn:/:Dx:/:Dg:     S
			       :Dn:   Deltas included (seq #)			  "	     :DS: :DS:...      S
			       :Dx:   Deltas excluded (seq #)			  "	     :DS: :DS:...      S
			       :Dg:   Deltas ignored (seq #)			  "	     :DS: :DS:...      S
			       :MR:   MR numbers for delta			  "		 text	       M
			       :C:    Comments for delta			  "		 text	       M
			       :UN:   User names			       User names	 text	       M
			       :FL:   Flag list 				 Flags		 text	       M
			       :Y:    Module type flag				  "		 text	       S
			       :MF:   MR validation flag			  "	       yes or no       S
			       :MP:   MR validation pgm name			  "		 text	       S
			       :KF:   Keyword error/warning flag		  "	       yes or no       S
			       :KV:   Keyword validation string 		  "		 text	       S
			       :BF:   Branch flag				  "	       yes or no       S
			       :J:    Joint edit flag				  "	       yes or no       S
			       :LK:   Locked releases				  "		:R:...	       S
			       :Q:    User-defined keyword			  "		 text	       S
			       :M:    Module name				  "		 text	       S
			       :FB:   Floor boundary				  "		  :R:	       S
			       :CB:   Ceiling boundary				  "		  :R:	       S
			       :Ds:   Default SID				  "		  :I:	       S
			       :ND:   Null delta flag				  "	       yes or no       S
			       :FD:   File descriptive text			Comments	 text	       M
			       :BD:   Body					  Body		 text	       M
			       :GB:   Gotten body				  "		 text	       M
			       :W:    A form of what (1) string 		  N/A	       :Z::M::I:       S
			       :A:    A form of what (1) string 		  N/A	   :Z::Y: :M: :I::Z:   S
			       :Z:    what (1) string delimiter 		  N/A		 @(#)	       S
			       :F:    SCCS file name				  N/A		 text	       S
			       :PN:   SCCS file path name			  N/A		 text	       S

	  *:Dt: = :Dt: :I: :D: :T: :P: :DS: :DP:

Examples
       The following is an example of a command line and what it produces on the standard output:
       prs -d"Users and/or user IDs for :F: are:
:UN:" s.file

	      Users and/or user IDs for s.file are:
	      xyz
	      131
	      abc

       This is another example and its output.
       prs -d"Newest delta for pgm :M:: :I: Created :D: By :P:" -r s.file

	      Newest delta for pgm main.c: 3.7 Created 77/12/1 By case

       This is an example of a special case:
       prs s.file

       This is what it may produce on the standard output:

	      D 1.1 77/12/1 00:00:00 cas 1 000000/00000/00000 MRs: bl78-12345 bl79-54321 COMMENTS: this is the comment	line  for  s.file  initial
	      delta  for each delta table entry of the ``D'' type.  The only keyletter argument allowed to be used with the special case is the -a
	      keyletter.

Diagnostics
       See for explanations.

Files
       /tmp/pr?????

See Also
       admin(1), delta(1), get(1), help(1), sccs(1), sccsfile(5)
       Guide to the Source Code Control System

																	    prs(1)
All times are GMT -4. The time now is 11:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy