Shell script questions


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script questions
# 1  
Old 11-19-2009
Bug Shell script questions

Hello.
I am a beginner and I need to create a script that goes:

There are several library where there are compressed files. I have to decompress all files that start with 'XA%' and retrieve all rows that contain 'CSSF' and copy this to a file.

Can anyone help me? Thank you in advance Smilie
# 2  
Old 11-19-2009
Members who create a topic need help, so it's not an usefull title.
Try something like that
Code:
uncompress -fc XA%* | grep CSSF > outfile

Jean-Pierre.
# 3  
Old 11-19-2009
Thank you very much
# 4  
Old 11-19-2009
Code:
find . -name "XA*" -exec zgrep 'CSSF' {} >> /tmp/output-file \;

# 5  
Old 11-19-2009
Thank you very much.
But -exe does not
with find . -name "XA*" -> I have the name of the file like XA*
I want to unzip all the file of the list
and after retrieve all rows that contain 'CSSF'
# 6  
Old 11-19-2009
Quote:
Originally Posted by papou5480
Thank you very much.
But -exe does not
with find . -name "XA*" -> I have the name of the file like XA*
I want to unzip all the file of the list
and after retrieve all rows that contain 'CSSF'
The '-exec zgrep' option retrieves all rows containing 'CSSF'.
The files XA* remain compressed (like in my solution).


Jean-Pierre.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Select answers from multiple questions using shell script

I have a text file in this format Some lines.... Question no: 1 The question? A. Answer 1 B. Answer 2 C. Answer 3 D. Answer 4 Answer:B Some lines.... Question no: 2 The question? (choose 2) (10 Replies)
Discussion started by: zorrox
10 Replies

2. Homework & Coursework Questions

Print questions from a questions folder in a sequential order

1.) I am to write scripts that will be phasetest folder in the home directory. 2.) The folder should have a set-up,phase and display files I have written a small script which i used to check for the existing users and their password. What I need help with: I have a set of questions in a... (19 Replies)
Discussion started by: moraks007
19 Replies

3. Shell Programming and Scripting

Shell scripting questions

I have a file like this. Pls help me to solve this. 08-24-2010 10:22:34,xxxxxxxxMessage : 111 08-24-2010 10:24:38,xxxxxxxbMessage : 000 08-24-2010 11:28:11,xxxxxxxcMessage : 111 08-24-2010 11:32:35,xxxxxxxdMessage : 111 08-24-2010 11:32:35,xxxxxxxeMessage : 111 (I should look for Message... (1 Reply)
Discussion started by: mnjx
1 Replies

4. Shell Programming and Scripting

Answer Terminal Questions With Shell Script?

First off, I am using Mac OS X, with Apple Remote Desktop. I have to install several app's on teachers' laptops which are on several cd's that I have made disk images of. (DMG's) To do rollouts quicker, I have written a script to mount the disk images and running the installers inside each of... (4 Replies)
Discussion started by: The Reepr
4 Replies

5. Shell Programming and Scripting

Few Important doubts and questions..(Unix/Shell)

Hi All, I have a few questions which I am unable to solve/answer. Please help me with them:- Command in Unix to determine if a Host is connected to the internet ? If a parenet process is killed what happens to the child process? How do I print the first 10 lines of a file in the... (1 Reply)
Discussion started by: shubhranshu
1 Replies

6. Shell Programming and Scripting

Questions on shell execution

Hi, I have a question regarding Korn shell script execution in HP-UX 11.11. What sort of environmental settings do I need to run a Korn shell script such as below without entering "./" at the begining of the command? cat test.ksh date I am able to do this with a user called infodba who... (6 Replies)
Discussion started by: stevefox
6 Replies

7. Shell Programming and Scripting

A few questions from a newbie(shell script)

Q1>How do i read and write to file in shell script. Here is what i want let's assume the filename as "file1" Read file1 Check the content of file1 which can be either "0" or "1" if(content == 0) { execute a command } flush file1(remove all contents in it) write "1" in to... (5 Replies)
Discussion started by: perk_bud
5 Replies

8. Shell Programming and Scripting

Shell/commands/scripting/c questions

1. Can anyone explain me what the line x=signal(SIGINT,nh); does? 2. How do I write a command to print the longest line in a file? 3. How do I write a command to print the last word of every line of a file using sed? 4. What exactly does this line do? :%s/^\(\)\(\)/\2\1/g^M... (3 Replies)
Discussion started by: Necrologist
3 Replies

9. Shell Programming and Scripting

Shell script fundamental Questions

Hi Can u please guide me to understand following script : $JAVA_HOME/bin/java -cp $CLASSPATH -Djava.naming.factory.initial=weblogic.jndi.T3InitialContextFactory -Djava.naming.provider .url=$INITIAL_CONTEXT_PROVIDER -Djava.naming.security.principal=system... (2 Replies)
Discussion started by: pankajkrmishra
2 Replies

10. UNIX for Dummies Questions & Answers

questions on ftp shell scripting

did a search but was not allowed to use 'ftp' because its too short of a word. for some reason, i can't seem to remember anything about ftp shell scripts - would someone please refresh my memory on the syntax and maybe give a short example? thanks for the time. (5 Replies)
Discussion started by: psyjoniz
5 Replies
Login or Register to Ask a Question