9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have a file such as below:
0 0 . . 0 0
0 0 0 0 0 0
1 1 1 1 1 1
1 1 1 1 1 1
0 0 0 1 0 1I want to count the number of 0 and 1 in each line (. represents no data) and print them into two columns, that is:... (3 Replies)
Discussion started by: Homa
3 Replies
2. Shell Programming and Scripting
Hello Folks,
I have a DataDumper variable and the output of the dataDumper is printed in the below manner.
print Dumper \%mnemonics;
VAR1 = {
'SYS-7-CLI_SCHEDULER_LOG_STORED' => ,
'CRYPTO-6-IKMP_MODE_FAILURE' => ,
'AAAA-4-SERVUNDEF' => ,
... (1 Reply)
Discussion started by: scriptscript
1 Replies
3. Shell Programming and Scripting
I have a script which takes backup of some configuration files on my server. It does that by using an array which contains the complete path to the files to backup.
It copys the files to a pre defined dir. Each "program" has it's own folder, ex. apache.conf is being copied to /predefined... (7 Replies)
Discussion started by: dnn
7 Replies
4. Shell Programming and Scripting
Hello there,
I have a file with few fields separated by ":". I wrote a below awk to manipulate this file:
awk 'BEGIN { FS=OFS=":" }\
NR != 1 && $2 !~ /^98/ && $8 !~ /^6/{print $0}' $in_file > $out_file
What I wanted was that if $8 field contains any of the values - 6100, 6110, 6200 -... (2 Replies)
Discussion started by: juzz4fun
2 Replies
5. UNIX for Dummies Questions & Answers
Is there a way to print multiple array elements without iterating through the array using bash?
Can you do something like...
echo ${array}and get all those separate elements from the array? (2 Replies)
Discussion started by: jrymer
2 Replies
6. Fedora
Hi All,
I have a general difficulty in understanding how to control single elements within a string. An example,
XYZ1234 ABCD5678 My expected output is :
ABCD1234 XYZ5678 (swapping subset of string elements of choice)
XYZ37 ACBD1214 (making calculations... (6 Replies)
Discussion started by: pawannoel
6 Replies
7. Shell Programming and Scripting
Hi,
My doubt is how to access array elements..
Situation is as below:
#!/bin/ksh
set -x
typeset -i x=0
typeset -i y=0
typeset -i BID=0
typeset -i count=0
while ] ; do
x=`expr $x + 1`;
hwmgr show scsi > scsi.tmp
while read line; do
set... (1 Reply)
Discussion started by: mansa
1 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I am writing a BASH shell script. I have an array that will contain IN ANY ORDER the following elements: DAY 8D MO NS.
I would like to erase the element DAY, but since the order of the elements in the array are random, I will not know which element # DAY is (ie it's not as simple as... (3 Replies)
Discussion started by: msb65
3 Replies
9. Shell Programming and Scripting
Hi,
I have this typical extraction problem in AWK.
I have 3 input files..
i) First one is somehow like an oracle of:-
foo 12,23,24
bla 11,34
car 35
ii)Second file is basically detailing the score for each of the second field of first file. Besides, for the first column, it is the... (3 Replies)
Discussion started by: ahjiefreak
3 Replies