10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am running a while loop in a script ro read a file line by line.
Now I want to run a grep only on the lines below the line I am that is being read by the while loop.
If my while loop is on line 4 of the file, the grep only runs below line 4 and does not include line 1,2... (3 Replies)
Discussion started by: Junaid Subhani
2. UNIX for Dummies Questions & Answers
Hi, This is my first post.
I have a korn shell script which outputs a select statment to a file. There is only one column and one row which contains a record count of the select statement.
The select statement looks something like this:
SELECT COUNT(some_field) AS "count_value"
... (2 Replies)
Discussion started by: MurdocUK
3. Shell Programming and Scripting
I am newbie to bash scripting. Could someone help me with the following.
I have log file with output as shown below
11/20/2013 9:11:23.64 Pinging xx.xx.xx.xx with 32 bytes of data:
11/20/2013 9:11:23.64 Reply from xx.xx.xx.xx:... (4 Replies)
Discussion started by: meena_2013
4. Shell Programming and Scripting
Does anyone know how to use awk to act like grep from a particular line number to the end of file? I am using Solaris 10 and I don't have any GNU products installed.
Say I want to print all occurrences of red starting at line 3 to the end of file.
red... (1 Reply)
Discussion started by: thibodc
5. Shell Programming and Scripting
Hello, I am trying to write a bash script which will give me the most negative number. Here is an example input:
Ce 3.7729752124 -4.9505731588 -4.1061257680
Ce -6.9156611391 -0.5991784762 7.3051893138
Ce 7.6489739875 0.3513020731 ... (6 Replies)
Discussion started by: sdl27789
6. Shell Programming and Scripting
I have a folder that contain 100's of subfolders namely:
Main folder -> GHFG
- Subfoders ->10
... (2 Replies)
Discussion started by: Lucky Ali
7. Shell Programming and Scripting
I plan to write a script and in the beginning, I will check if there's any existing previous process running, if YEs, then exit directly, if Not, then continue.
NUM=`ps -ef | grep $0 | grep -v grep | wc -l`
ps -ef | grep $0 | grep -v grep
echo "NUM ==> $NUM"
if... (6 Replies)
Discussion started by: tiger2000
8. UNIX for Dummies Questions & Answers
Above is the content of File1.txt, i want to get the Number of Occurence to order, lets say if OMC LA = 1, OMC LS=3, and OMC LK=2..
omc_ident="OMC LA" or "OMC LK" or "OMC LS"
omc_num=`grep '^OMC' File1.txt| grep... (4 Replies)
Discussion started by: neruppu
9. UNIX for Dummies Questions & Answers
I am given a file with a list of names for the first 20 characters. The 20 characters after is a list of names that somebody is supposed to team up with.
Now i'm trying to write a simple script that will read a name somebody inputs and then looks only in the first 20 characters.
For example.... (2 Replies)
Discussion started by: MaestroRage
10. Shell Programming and Scripting
I tried to simulate some example in Shell particularly finding item and matching in another file.
A very simple example:-
Basically I have 2 files, file A and file B.
In file A, I have columns of fields such that:-
In file B, I have columns of fields... (7 Replies)
Discussion started by: ahjiefreak