10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In the below awk I am splitting $7 on the : and then counting each line or NM_xxxx. If the $1 value is the same for each line then print the $7 that occurs the most with the matching $1 value. The awk seems close but I am not sure what is going on. I included a description as well as to what I... (1 Reply)
Discussion started by: cmccabe
1 Replies
2. Shell Programming and Scripting
I have test.sh file as below :
set -A IDARR $ID
echo | awk -f test.awk -v TempArr="${IDARR
}"
I have test.awk file as below :
BEGIN {
Flag = 1;
}
{
print "Hello";
for(i in TempArr)
{
print i;
}
} (9 Replies)
Discussion started by: nes
9 Replies
3. UNIX for Dummies Questions & Answers
How do i pass an array from test4.sh to a function in another shell script test5.sh, basically i am sourcing the test5.sh in test4.sh and printing the contents, but not working below are my trial scripts, please help, thank you.
#!/bin/bash
# /usr/local/dw/archive/test5.sh
print_array()
{... (5 Replies)
Discussion started by: Ariean
5 Replies
4. Shell Programming and Scripting
Hello All,
Can you please help me with the below.
#!/bin/bash
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1"
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
Discussion started by: Ariean
14 Replies
5. Shell Programming and Scripting
Hey guys,
I'm new to shell scripting and I'm trying to write a script that takes user input and copies the specified columns from a data file to a new one. In order to account for the possibility of a variable number of columns to copy I wrote a loop that encodes the user's choices in an array... (16 Replies)
Discussion started by: shaner
16 Replies
6. Shell Programming and Scripting
Hi all,
I been looking for a solution to the fact that when I use:
for (i=1; i<=NF; i++) print $ifields that are originally in a single line are printed in a single line
I have severals files for which the first 7 are the same, but the number of variables after that can vary, for example NF... (5 Replies)
Discussion started by: PaulaL
5 Replies
7. Shell Programming and Scripting
Hi, as the title, I have an array @f_lines with gene information in it. How can I put the content of @f_lines into a file so that I can read it?
I tried this:
open(OUTPUT, "file"); # put gene information in this file;
@f_lines = ("gene1", "gene2", "gene3"...); # gene information;
print... (3 Replies)
Discussion started by: lyni2ULF
3 Replies
8. Shell Programming and Scripting
The code below prints outs each array element, but it always says the array length is 1 even though its not. What am i doing wrong?
function printArray(){
#here should check if it is an array and that an arg exits
echo "Priting array"
myarr="${@}"
echo... (2 Replies)
Discussion started by: chrisjones
2 Replies
9. Shell Programming and Scripting
Hi Anyone can help me??i writing a perl using array to translate ip address to the hostname my script are below.this line print "$myhost{$ipaddr}\n"; blank :mad:hostname dint come out:mad::mad:
#!/usr/local/bin/perl
@ipaddr=("192.1.168.2","172.25.1.13","129.1.2.5");
%myhost = { 192.1.168.2... (4 Replies)
Discussion started by: netxus
4 Replies
10. Shell Programming and Scripting
I am beginner in awk
awk 'BEGIN{for(i=1;(getline<"opnoise")>0;i++) arr=$1}{print arr}'
In the above script, opnoise is a file, I am reading it into an array and then printing the value corresponding to index 20. Well this is not my real objective, but I have posted this example to describe... (19 Replies)
Discussion started by: akshaykr2
19 Replies