Sponsored Content
Full Discussion: Unable to Print Count
Top Forums Shell Programming and Scripting Unable to Print Count Post 302592169 by kmsekhar on Monday 23rd of January 2012 04:53:32 AM
Old 01-23-2012
Unable to Print Count

Hi All,


I am performing addition of two inetger variables which assigning output to a new variable getting following error.


Check1.sh
Code:
#!/bin/ksh
filesrc=/usr/kk/Source1.txt
filetgt=/usr/kk/Source2.txt
 
FINAL_COUNTS= `awk '{n++} END {printf "%012d\n",n}' ${filesrc} ${filetgt}`
 
echo 'Final Count is:'$FINAL_COUNTS

Below is the output:

Code:
 
+ awk {n++} END {printf "%012d\n",n} /usr/kk/Source1.txt /usr/kk/Source2.txt
+ 000000000014
+ FINAL_COUNTS=
./Check1.sh[5]: 000000000014:  not found.

 

10 More Discussions You Might Find Interesting

1. SCO

Non-Root Users Unable to Print

UnixWare 7, Release 7.1.3 We have a customer that has frequent issues with Non-Root users being unable to print. They are able to print w/o issues, but all of the sudden it stops working. The only workaround we have at this point is to reboot the server. It is happening weekly according to... (1 Reply)
Discussion started by: cfshd
1 Replies

2. AIX

Unable to print Cyrillic fonts

Hi All I confifured HP 4250 printer on AIX server..I am unable to print cyrillic fonts prints. Please assist.. (0 Replies)
Discussion started by: kandatihari
0 Replies

3. Shell Programming and Scripting

count identical strings print last row and count

I have a sorted file like: Apple 3 Apple 5 Apple 8 Banana 2 Banana 3 Grape 31 Orange 7 Orange 13 I'd like to search $1 and if $1 is not the same as $1 in the previous row print that row and print the number of times $1 was found. so the output would look like: Apple 8 3 Banana... (2 Replies)
Discussion started by: dcfargo
2 Replies

4. Shell Programming and Scripting

Count and print all repeating words in a line

Gurus, I have a file containing lines like this : Now, number of words in each line varies. My need is, if a word repeats in a line get it printed. Also total number of repeats. So, the output would be : Any help would be highly appreciated. Thanks & Regards (5 Replies)
Discussion started by: AshwaniSharma09
5 Replies

5. Shell Programming and Scripting

Search, group , print count

hi All, need help. have a file like below A, error in 123 B, log files are present A, error in 23444 B, log files are present A, move to next line C, matching messages -- expected output-- A , count =2 , error in * A , count =1 , move to next line B , count =2 , log files are present... (2 Replies)
Discussion started by: arun1401
2 Replies

6. Shell Programming and Scripting

Unable to print dynamic arguments in for loop

Hi All, I want to pass few dynamic arguments to shell script. The number of arguments differ each time I call the script. I want to print the arguments using the for loop as below. But not working out. for (( i=1; i<=$#; i++ )) do echo $"($i)" done /bin/sh test.sh arg1 arg2 arg3 ... (1 Reply)
Discussion started by: laalesh
1 Replies

7. Shell Programming and Scripting

Count Column and Print at last

HI Guys, Count base on column A Input:- U00393 6 000100000 U00393 7 000100001 U00393 8 000100002 U00393 9 000100003 U00393 10 000100004 U00393 11 000100005 U00928 6 000100000 U00928 7 000100001 U00964 6 000100000 U00964 7 000100001 U00964 8 000100002 U00972 6 000100000 U00972... (3 Replies)
Discussion started by: asavaliya
3 Replies

8. Shell Programming and Scripting

Count and print the number of occurences

I have some files as shown below GLL ALM 654-656 654 656 SEM LYG 655-657 655 657 SEM LYG 655-657 655 657 ALM LEG 656-658 656 658 ALM LEG 656-658 656 658 ALM LEG 656-658 656 658 LEG LEG 658-660 658 660 LEG LEG 658-660 658 660 The value of GLL is... (5 Replies)
Discussion started by: arch
5 Replies

9. Shell Programming and Scripting

Unable to print block of data

Hi All, Iam unable to print the below block and getting the error.Can anyone please help me in this. Input Data eaits001z$ echo "-------LINENO_JOBID_VAL--------${LINENO_JOBID_VAL}---" -------LINENO_JOBID_VAL--------58167|253473 58169|253473 58171|253473 58179|253473 58180|253473 58181|257311... (9 Replies)
Discussion started by: cskumar
9 Replies

10. Shell Programming and Scripting

Print count of unique values

Hello experts, I am converting a number into its binary output as : read n echo "obase=2;$n" | bc I wish to count the maximum continuous occurrences of the digit 1. Example : 1. The binary equivalent of 5 = 101. Hence the output must be 1. 2. The binary... (3 Replies)
Discussion started by: H squared
3 Replies
SNMP_HOSTRES(3) 					   BSD Library Functions Manual 					   SNMP_HOSTRES(3)

NAME
snmp_hostres -- host resources module for bsnmpd(8) LIBRARY
(begemotSnmpdModulePath."hostres" = /usr/lib/snmp_hostres.so) DESCRIPTION
The snmp_hostres module implements the HOST-RESOURCES-MIB as standardized in RFC 2790. RESTRICTIONS
Not all information in the MIB is meaningful in FreeBSD or is available. The following variables are not implemented or carry no informa- tion: hrFSType There are several types of file systems for which no appropriate OID exists yet which are supported by FreeBSD. For smbfs, procfs and devfs , hrFSOther is returned. In all other cases, hrFSUnknown. hrFSBootable It is questionable what bootable means here. Does it mean that the BIOS is available to start a boot on that file system or does it mean that there is something bootable? In either case this information is not available so this variable returns True for the root file system (which is not necessarily correct) and False for all others. hrFSLastFullBackupDate, hrFSLastPartialBackupDate This is not available and always returns an empty string. Theoretically, this could be retrieved from /etc/dumpdates, which would hardly be correct given the different ways of doing backups. hrDiskStorageTable Floppy devices are currently not reported. Also the names of the disks are hard-coded in the module. FILES
/usr/share/snmp/defs/hostres_tree.def The description of the MIB tree implemented by snmp_hostres. /usr/share/snmp/mibs/HOST-RESOURCES-TYPES.txt /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt /usr/share/snmp/mibs/BEGEMOT-HOSTRES-MIB.txt This is the MIB that is implemented by this module. SEE ALSO
gensnmptree(1), snmpmod(3) AUTHORS
Victor Cruceru <soc-victor@FreeBSD.org> BSD
January 3, 2006 BSD
All times are GMT -4. The time now is 10:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy