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
LEARN ABOUT SUSE
create-branching-keyboard
create-branching-keyboard(1) User Commands create-branching-keyboard(1)
NAME
create-branching-keyboard - create branching keyboards for GOK
SYNOPSIS
create-branching-keyboard [--usage] infile [n-desired-rows]
DESCRIPTION
create-branching-keyboard takes an input data file and creates a family of branching keyboard XML files in the format that GOK expects.
Given an input file named test.data, create-branching-keyboard creates test.data.kbd, which in turn refers to a family of *.kbd files that
are created based on data in the input file.
OPTIONS
The following options are supported:
--usage Display usage information.
OPERANDS
The following operands are supported:
infile The name of the input file.
n-desired-rows If specified, create-branching-keyboard attempts to create keyboards with the specified number of rows. The recommended
values are between 2 and 6.
EXTENDED DESCRIPTION
create-branching-keyboard can be used to create families of branching keyboards from UTF-8 input files. The format of the input files is as
follows:
o Lines beginning with '#' are ignored.
o The rest of the input file consists of consecutive pairs of lines. The first line of a pair is typically ignored, but should serve as
a UTF-8 label describing the "primary key" in the next line. The second line of the pair consists of a single UTF-8 character followed
by a ':' color delimiter, and a string of UTF-8 characters to which the initial character may branch.
The resulting XML file, after processing, defines .kbd files such that each prefix 'primary key' forms a key on the GOK keyboard whose
label is the "primary key" UTF-8 character, and which branches to a keyboard consisting of the following UTF-8 characters, one per key.
create-branching-keyboard is particularly useful in creating branching keyboards for ideographic languages. For instance, the primary key
for a given line may consist of the UTF-8 character for a 'radical' such as hng.
EXAMPLES
Example 1: Creating Branching Keyboards From a File Called test.data
example% create-branching-keyboard test.data
EXIT STATUS
The following exit values are returned:
0 Application exited successfully
>0 Application exited with failure
FILES
The following files are used by this application:
/usr/bin/create-branchinExecutable to create branching keyboards for GOK
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWgnome-a11y-gok-share |
| | |
| |SUNWgnome-a11y-gok |
+-----------------------------+-----------------------------+
|Interface stability |External |
+-----------------------------+-----------------------------+
SEE ALSO
Latest version of the GNOME Desktop User Guide for your platform.
gok(1)
NOTES
The create-branching-keyboard utility is experimental and unsupported.
Written by Bill Haneman, Sun Microsystems Inc., 2004.
SunOS 5.10 7 Sep 2004 create-branching-keyboard(1)