10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is there a reliable way to deal with whitespace in array indicies?
I am trying to annotate fails in a database using a table of known fails.
In a begin block I have code like this:
# Read in Known Fail List
getline < "'"$failListFile"'"; getline < "'"$failListFile"'"; getline <... (6 Replies)
Discussion started by: Michael Stora
6 Replies
2. Shell Programming and Scripting
I have the following code, and I am changing it to
#!/bin/bash
hasArgumentCModInfile=0
hasArgumentSrcsInfile=0
hasArgumentRcvsInfile=0
OLDIFS="$IFS"
IFS="|=" # IFS controls splitting. Split on "|" and "=", not whitespace.
set -- $* # Set the positional... (3 Replies)
Discussion started by: kristinu
3 Replies
3. UNIX for Dummies Questions & Answers
I have this piece of code. The first if statement is not working, however the second if statement is working fine.
I have set a value for Srcs to be file.srcs and want to print it.
If no value for Rcvs is set, I get the print statement correctly
hasValue="file.srcs"
if ${hasValue}; then
... (0 Replies)
Discussion started by: kristinu
0 Replies
4. Shell Programming and Scripting
Hi All,
I got stuck up with shell script where i use awk. The scenario which i am working on is as below.
I have a file text.txt with contents
COL1 COL2 COL3 COL4
1 A 500 400
1 B 500 400
1 A 500 200
2 A 290 300
2 B 290 280
3 C 100 100
I could able to sum col 3 and col4 based on... (3 Replies)
Discussion started by: imsularif
3 Replies
5. Shell Programming and Scripting
i have a file like this
< '393200103052';'H3G';'20081204'
< '393200103059';'TIM';'20110111'
< '393200103061';'TIM';'20060206'
< '393200103064';'OPI';'20110623'
> '393200103052';'HKG';'20081204'
> '393200103056';'TIM';'20110111'
> '393200103088';'TIM';'20060206'
Now i have to generate a file... (9 Replies)
Discussion started by: shruthi123
9 Replies
6. Shell Programming and Scripting
Hello,
i'm writing a little script that checks a .txt file for a specific ID that came after 9:10 am which outputs it's data to a file LateUsers.txt
once done , it should mention the following:
Number of late users
Number of unique late users
Over all late users percentage
number of... (0 Replies)
Discussion started by: rollyah
0 Replies
7. Shell Programming and Scripting
I'm at wits end with this issue and my troubleshooting leads me to believe it is a problem with the file formatting of the array referenced by my script:
awk -F, '{if (NR==FNR) {a=$4","$3","$2}\
else {print a "," $0}}' WBTSassignments1.txt RNCalarms.tmp
On the WBTSassignments1.txt file... (2 Replies)
Discussion started by: JasonHamm
2 Replies
8. Shell Programming and Scripting
Hi all,
#!/usr/dt/bin/dtksh
typeset -A wavelength
wavelength=650
wavelength=590
wavelength=510
wavelength=475
wavelength=445
wavelength=400
I have created an associative array like the one above.
Now I am trying to print the values
If i give print ${wavelength} it is... (4 Replies)
Discussion started by: prasperl
4 Replies
9. UNIX for Dummies Questions & Answers
About associative nature of awk arrays i'm still confused, not able to understand yet how array element can be accessed based on a string, I got one example at gawk manual to illustrate associative nature of awk arrays, it goes here:
Codeawk '
# Print list of word frequencies
{
for (i = 1;... (3 Replies)
Discussion started by: nervous
3 Replies
10. UNIX for Dummies Questions & Answers
Is it possible to say..
myArr=34
myArr=15
? (11 Replies)
Discussion started by: yongho
11 Replies