10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I'm trying to create a shell script that takes a awk script that I wrote and a filename as an argument. I was able to get that done but I'm having trouble figuring out how to keep the header of the output at the top but sort the rest of the rows alphabetically. This is what I have now but it is... (1 Reply)
Discussion started by: Eric7giants
1 Replies
2. UNIX for Beginners Questions & Answers
My code is listed below, I'm trying to figure out what the problem is and what I can do to fix it. The output i'm getting is:
Name Low High Average
0 0 0.00
The correct output I want is the name of the Assignment, the lowest score and highest score obtained, and the Average Score... (10 Replies)
Discussion started by: Marquez3105
10 Replies
3. Shell Programming and Scripting
Hey guys, awk is putting out too many results, two of each specifically. See below.
Code:
read CPU_VENDOR_ID <<< $(cat /proc/cpuinfo | grep "vendor_id" | awk -F: '{print $2}')
echo $CPU_VENDOR_ID
echo
Output:
AuthenticAMD AuthenticAMD
I only want it to print out "AuthenticAMD" once.
... (7 Replies)
Discussion started by: 3therk1ll
7 Replies
4. Shell Programming and Scripting
Hi All,
I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file.
Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Discussion started by: adept
4 Replies
5. Shell Programming and Scripting
I'm using AIX 5.3 and running a awk replace to modify data as follows:
echo 1234: 1234 123 123 444 555 666 7777 | awk '/^:/{split($2,N);n=N} {n=$1} {sub(n,n+10000000)}1'
10001234 1234 123 123 444 555 666 7777
dumb question.. how do I get the colon back in, so it outputs
10001234: 1234... (4 Replies)
Discussion started by: say170
4 Replies
6. Shell Programming and Scripting
Hello everyone,
I need some assistance with what I thought would have been a very simple script.
Purpose of Script:
Script will parse through a source file and modify (search/replace) certain patterns and output to stdout or a file. Script will utilize a "control file" which will contain... (12 Replies)
Discussion started by: packetjockey
12 Replies
7. Shell Programming and Scripting
Below is my script:
#!/bin/sh
#echo "Please type oracle-lower case please:"
#read X
#if ]
#then
# echo "Sorry that is not oracle, try again"
# exit 1
#else
# echo Thank you
#fi
find / -name oracle 2>/dev/null |
while read line
do
bdf 2>/dev/null |... (6 Replies)
Discussion started by: bigben1220
6 Replies
8. UNIX for Dummies Questions & Answers
Hi folks,
Here i have written a shell script to calculate a maximum number from 10 numbers entered on command line.
max=0
echo Enter 10 numbers , one at a time
for i in 1 2 3 4 5 6 7 8 9 10
do
read n
max=`expr $max + $n`
if --- At this last step there is some problem, it gives error... (5 Replies)
Discussion started by: rits
5 Replies
9. Shell Programming and Scripting
Hi all
Just wondering if someone can help me with this. I'm trying to write a script that processes the output of another file and prints only the lines I want from it.
This is only the second script I have written so please bare with me here. I have referred to the literature and some of the... (3 Replies)
Discussion started by: javathecat
3 Replies
10. Shell Programming and Scripting
Please i need your help.
i made this script with awk, this scripts count and list a pattern for each directory in the output as shown. but not as desired. i want the output will be listed in a tabular way, using awk:
cuenta_cdrs()
{
for dir in *
do
cd $dir
for file in *
do
... (4 Replies)
Discussion started by: alexcol
4 Replies