07-29-2005
as an example of looping from the command line may looks something like this (tested with korn shell):
$ for i in `ls -1`; do file $i; done
.. this uses the file command to show you the file type for each file on the working directory...
does this answer your question?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear all,
I have a text file like below.
eg.txt
abcd
efgh
ijkl
mnop
I need a script, which should read the text file eg.txt and assign each line as a parameter. This , i wil use further to pass it a java command to invoke. All inside a for loop
Need your help on this.
With... (2 Replies)
Discussion started by: KrishnaSaran
2 Replies
2. Shell Programming and Scripting
Hi I am brand new to programming, I dont know how to go about this task, or what language is best for this...If there is an easy solution in different languages, I would love to see them. I want to learn about the steps to take on this, so Please put in comments where code is used.
I believe in... (9 Replies)
Discussion started by: perlrookie
9 Replies
3. Shell Programming and Scripting
Hi ,
I need some help on perl/sed conditional replacement
The situation is like below .
I have a file contents like below .
AAA|BBB|CCC|DDD
AAA|BCF|CCC|HHH
AAA|BVF|JJJ|KKK
Here in the above file . I know my second column value (taking "|" as my delimited )
Basically I have to... (3 Replies)
Discussion started by: robin.r888
3 Replies
4. Shell Programming and Scripting
Hi ,
I have a .csv file,from which I want to remove some data from each column as below.
Source Data
GT_12_AUDIT,SCHEDULED,NOZOMI2010/GT_12_AUDIT,CTSCAN/Zh_GT_6547887/GT_12_AUDIT,CTSCAN/Zh_GT_6547887... (3 Replies)
Discussion started by: gaur.deepti
3 Replies
5. Shell Programming and Scripting
Hi, I have a very large file I want to extract lines from. I'm hoping Grep can do the job, but I'm running into problems.
I want to return all lines that match a pattern. However, if the following line of a matched line contains the word "Raw" I want to return that line as well.
Is this... (3 Replies)
Discussion started by: redbluefish
3 Replies
6. Shell Programming and Scripting
Hi, Unix gurus,
I have a requirement as following:
checking existing file, if the file only contain one line. then append "No data" else keep existing file as is.
can i achieve this by in command line without write a script.
:wall:
Thanks in advance. (4 Replies)
Discussion started by: ken002
4 Replies
7. Shell Programming and Scripting
I have a req. where i need to read data from multiple files and take counts of row which satisfy the condition. e.g.:
FILE1:
Col1 Col2 Col3
12 ab cd
15 de fg
25 gh tm
FILE2:
Col1 Col2 Col3
21 ab1 cd1
13 de1 fg1
25 gh1 tm1
---
---
FILE-N...
i need to find the count of rows... (6 Replies)
Discussion started by: kunal007
6 Replies
8. Shell Programming and Scripting
Greetings!
First post for this newbie :)
If anyone has a moment to spare, I have a quick question for the community. For the record, I'm running Xubuntu 12.04...
Based on a few hours' digging about, I've created an executable test script, "test.sh" which incorporates the following code:
... (7 Replies)
Discussion started by: LinQ
7 Replies
9. Shell Programming and Scripting
How could be removed \n only if appearing at position 80 in the line? (4 Replies)
Discussion started by: RomanF
4 Replies
10. Shell Programming and Scripting
I have a for loop that constructs a variable "filelistonly" having entries separated by "\n" new line.
The second, third & fourth while loops are my attempt to iterate the variable "filelistonly" upon new line "\n", however non of them work.
Below is my script:
//First Loop
for i in... (2 Replies)
Discussion started by: mohtashims
2 Replies