Hello everyonel,
I have an array set like so
num=4
read name
arr=name
I go through while loop to assign different values to different array element from 1 to 4. when I try to access the FIRST element of the array I get the last one first. Like if I say ${arr} it will show the last element... (4 Replies)
Hello,
I wonder if it is possible to pass and use variables from shell environment into sed or awk. I am trying to achieve something similar to the following using sed or awk:
var=some_regular_expression
grep "$var" filename # Will extract lines from filename
The following code,... (3 Replies)
How do I access one of the indices in array tst with the code below?
tst=sprintf("%5.2f",Car / 12)
When I scan thru the array with
for ( i in tst ) { print i,tst }
I get the output of:
vec-7 144
But when I try this in the END
print tst
It looks like it's not set.
What am... (6 Replies)
I am trying to pass a shell array I created to match on values amongst other things.
I have a sample:
#! /bin/ksh
i=0
for id in `cat id.lst`
do
IDs=$id
(( i=i+1 ))
done
cat sqloutput.txt | awk -F, -v ids=$ID '{
# Do stuff
}'
But it looks as if I cannot do this.... (1 Reply)
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)
Hi,
I want to access a variable outside the awk program. My program is as below:- I can not access the exact value of k (See the last line of the program).
#!/usr/bin/sh
j=10
k=1
#k is declared outside awk
awk '
BEGIN {
i=1;
j1="'"$j"'"
printf("\n ## Value of j1 is %d ##", j1);
... (2 Replies)
hi all, i've a requirement like this.
i want to access the contents of an array declared in one script,which is a bash script, to a second script which is a perl script.
actually i want a sort of global variable which can be accessed in other script
like environmen variables and also i can... (3 Replies)
Hi all,
I can’t resolve an array element access issue on (Linux/pdksh) .. So I’m positing for advice.By the way - a friend demonstrated to me - same script works as expected under Solaris.
I have been working on a documentation project where many *.jpg screen shots are used in the... (4 Replies)
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
LEARN ABOUT NETBSD
fincore
FINCORE(1) BSD General Commands Manual FINCORE(1)NAME
fincore -- query in-core status of file pages
SYNOPSIS
fincore [-qs] file ...
DESCRIPTION
The fincore utility queries and displays in-core status of specified files.
Note that the result can already be stale when being output due to other activities in the system. Thus it should be used only for advisory
purposes.
The fincore utility accepts the following options.
-q The quiet mode. Outputs nothing unless the file has in-core pages.
-s The summary mode. Only shows number of pages.
EXAMPLES
The following example shows that /bin/cat and /bin/cp are fully cached in-core while the other executables are not in-core. numbers shown in
the default output are page indexes in the file of each in-core pages.
% fincore /bin/c*
/bin/cat: 0 1 2 3
/bin/chio:
/bin/chmod:
/bin/cp: 0 1 2 3 4 5
/bin/cpio:
/bin/csh:
% fincore -s /bin/c*
/bin/cat: 4 / 4 in-core pages (100.00%)
/bin/chio: 0 / 5 in-core pages (0.00%)
/bin/chmod: 0 / 3 in-core pages (0.00%)
/bin/cp: 6 / 6 in-core pages (100.00%)
/bin/cpio: 0 / 36 in-core pages (0.00%)
/bin/csh: 0 / 41 in-core pages (0.00%)
SEE ALSO mincore(2)AUTHORS
The fincore utility is written by YAMAMOTO Takashi.
CAVEATS
The concept of page cache is an implementation detail of the kernel. The fincore utility works using some assumptions on the current imple-
mentation. Thus it might stop working in a future version of NetBSD.
BUGS
The amount of CPU time the current implementation of fincore utility would take is roughly proportional to the file sizes. Ideally it should
be proportional to the number of in-core pages.
BSD January 5, 2012 BSD