10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm on Linux version 2.6.32-696.3.1.el6.x86_64, using the Ksh shell.
I'm working with the input file:
John Daggett, 341 King Road, Plymouth MA
Alice Ford, 22 East Broadway, Richmond VA
Orville Thomas, 11345 Oak Bridge Road, Tulsa OK
Terry Kalkas, 402 Lans Road, Beaver Falls PA
Eric Adams,... (2 Replies)
Discussion started by: prooney
2 Replies
2. Shell Programming and Scripting
My code is something like below.
#/bin/bash
for i in `ps -ef | grep pmon | grep -v bash | grep -v grep | grep -v perl | grep -v asm | grep -v MGMT|awk '{print $1" "$8}'`
do
echo $i
ORACLE_SID=`echo $line | awk '{print $2}'`
USERNAME=`echo $line | awk '{print $1}'`
done
=============
But... (3 Replies)
Discussion started by: tapia
3 Replies
3. UNIX for Dummies Questions & Answers
I have this output from a loop
a11
1,2
3,4
5,6
7,8
12,8
5,4
3,6
a12
10,11
12,13
15,18
20,22
a13
... (3 Replies)
Discussion started by: maryre89
3 Replies
4. Shell Programming and Scripting
I am using awk to read lines from a CSV file then put data into other files. These other files are named using the value of a certain column. Column 7 is a name such as "att" or "charter" . I want to end up with file names with the value of column 7 appended to them, like this:
... (5 Replies)
Discussion started by: dodgerfan78
5 Replies
5. Shell Programming and Scripting
Have built this script, the output is what I needed, but NR 6 is omitted. Why? Is it an error? I am using Gawk.
'{nr=$2;f = $1} END{for (i=1;i<=f;i++) if (nr != i) print i, nr }' input1.csv >output1.csvinput1.csv
1 9
3 5
4 1
7 6
8 5
10 6
output1.csv > with the missing line number 6. 6 is... (5 Replies)
Discussion started by: sdf
5 Replies
6. UNIX and Linux Applications
Hi,
I'm trying to figure out a way to find which line in my file.txt with IP addresses:
192.168.0.1
192.178.0.2
etc...
returns specific result when I execute command affecting all lines.
For example when I run:
for line in `cat file.txt`;
do
snmpget $line
done
it displays the... (5 Replies)
Discussion started by: svetoslav_sj
5 Replies
7. Shell Programming and Scripting
Hi all,
after hours of playing around with this and scouring the web I decided to ask my fellow UNIX operators as I can't wrap my head around this.
First off,
I want to parse an input file with tabs (I could pull this off easily with different delimiters) but I was trying to make nicer... (2 Replies)
Discussion started by: Keepcase
2 Replies
8. Shell Programming and Scripting
When I run the following command in the shell it works fine. It prints a city name and then a path for a file.
~$ for i in `awk -F':' '{print $0}' /home/knoppix/Desktop/data/subs | grep -m 1 $ city | sed "s/:/ /"`
>do
>echo $i
>done
Now, when I place it in this shell script (sh) it prints... (6 Replies)
Discussion started by: afroCluster
6 Replies
9. Shell Programming and Scripting
I need to extract a value from a text file into a ksh script, and change the last two letters to "00". awk gets the right value (2500 in this example), but the variable has no value.
I use the following command:
StartTime=expr nawk 'NR==20 {print $11;exit}' $New_FILE
echo 1 $StartTime... (4 Replies)
Discussion started by: Iliklev
4 Replies
10. UNIX for Dummies Questions & Answers
I have a file called /ACCT/users that holds information on accounts to be created line by line.
I'm trying to create accounts and change the password to a generic password.
I want to probe the /etc/passwd file to check if there is already a user with the name i'm trying to create and if... (7 Replies)
Discussion started by: switchkill
7 Replies