incrementing the variable name along with the data?
Hello folks.
I am trying to increment my variable names to match a counter that is to be used later on...
Basically, i have a for loop that lists directories (for example TEST_OS DVP_OS PROD_OS ) but this loop is not static, it may contain 3 directory once and the next run 5 directories.
I then, want to assign "selection1" to TEST_OS, "selection2" to DVP_OS and "selection3" to PRD_OS. Again, those are not static...
Here is the code i have for now, but the "combining" of variables is not working... (selection$counter=$i) What i want, is that the variable selection1=TEST_OS and so forth...
I have 3 columns in an excel sheet.
c1 c2 c3
EIP_ACCOUNT SMALL_TS_01 select A.* from acc;
All the above 3 col shoud be passed a variable in the unix code.
1.How to read an excel file
2.How to pass these data as variable to the unic script (1 Reply)
Hi all,
I have a variable with date as 20080831 . Now I want to increment it as 20080901 and so on.Is there any command for this. Please help me.
thanks
rameez (1 Reply)
Hi All,
Iam trying to increment a variable
Following is the code
#!/usr/bin/ksh
i=1;
i='expr $i+1';
echo $i;
Output:
expr $i+1
not able to understand why its happening in that way
i was expecting result as 2... if the above method is worng .. can you help how i can get... (3 Replies)
1. The problem statement, all variables and given/known data:
Variable is resetting to 0 after incrementing in while loop
My bit of scripting displays the current users logged in the machine.
Then it reads in a specific username and displays the processes for that user.
The portion that I... (3 Replies)
When I did,
echo $SHELL in cmd prompt of putty,
its displaying /bin/sh
And in my shell script.,
I hav started with.,
#!/bin/sh
and
i=1;
while ;
do
.
.
.
i=$; (9 Replies)
Hi,
I am using BASH. I have encountered a situation where the following is necessary (but I am not sure how to do it):
#Define multiple arrays, whose names only differ by a number:
ARRAY_1=(1 2 3)
ARRAY_2=(4 5 6)
ARRAY_3=(7 8 9)
#Define ARRAY_AMOUNT, the number of arrays. In this case... (1 Reply)
Hi,
want to increment a variable in a for loop like this:
for (( c=$total-1; c>=0; c-- ))
do
if ;
then
maximo=$valores
fi
done
But it gives the error:
No such file or directory
How can i do this only incrementing the c variable?
Thanks (8 Replies)
Hi All,
I was wondering how I can convert each line in an input file where fields are separated by variable width spaces into a CSV file. Below is the scenario what I am looking for.
My Input data in inputfile.txt
19 15657 15685 Sr2dReader 107.88 105.51... (4 Replies)
Hi
I have the below set of lines , i need to duplicate these lines 1000 times, also eevrytime when it is incremented , it should increment the one in Blue color.
130400030000010000200001
130400030000010000200002
140050030000010000200005A
eg:
130400030000010000200001... (5 Replies)
This is part of a larger script where I need to pass only 1 line of a file to the script, based on a variable and not a direct reference.
As part of a for loop :
# for((line=0;line<50;line++)); do
# awk ‘NR==$line' PhraseList.txt; done
... (5 Replies)
Discussion started by: Seth
5 Replies
LEARN ABOUT FREEBSD
timecounters
TIMECOUNTERS(4) BSD Kernel Interfaces Manual TIMECOUNTERS(4)NAME
timecounters -- kernel time counters subsystem
SYNOPSIS
The kernel uses several types of time-related devices, such as: real time clocks, time counters and event timers. Real time clocks are
responsible for tracking real world time, mostly when the system is down. Time counters are responsible for tracking purposes, when the sys-
tem is running. Event timers are responsible for generating interrupts at a specified time or periodically, to run different time-based
events. This page is about the second.
DESCRIPTION
Time counters are the lowest level of time tracking in the kernel. They provide monotonically increasing timestamps with known width and
update frequency. They can overflow, drift, etc and so in raw form can be used only in very limited performance-critical places like the
process scheduler.
More usable time is created by scaling the values read from the selected time counter and combining it with some offset, regularly updated by
tc_windup() on hardclock() invocation.
Different platforms provide different kinds of timer hardware. The goal of the time counters subsystem is to provide a unified way to access
that hardware.
Each driver implementing time counters registers them with the subsystem. It is possible to see the list of present time counters, via the
kern.timecounter sysctl(8) variable:
kern.timecounter.choice: TSC-low(-100) HPET(950)i8254(0)ACPI-fast(900) dummy(-1000000)
kern.timecounter.tc.ACPI-fast.mask: 16777215
kern.timecounter.tc.ACPI-fast.counter: 13467909
kern.timecounter.tc.ACPI-fast.frequency: 3579545
kern.timecounter.tc.ACPI-fast.quality: 900
kern.timecounter.tc.i8254.mask: 65535
kern.timecounter.tc.i8254.counter: 62692
kern.timecounter.tc.i8254.frequency: 1193182
kern.timecounter.tc.i8254.quality: 0
kern.timecounter.tc.HPET.mask: 4294967295
kern.timecounter.tc.HPET.counter: 3013495652
kern.timecounter.tc.HPET.frequency: 14318180
kern.timecounter.tc.HPET.quality: 950
kern.timecounter.tc.TSC-low.mask: 4294967295
kern.timecounter.tc.TSC-low.counter: 4067509463
kern.timecounter.tc.TSC-low.frequency: 11458556
kern.timecounter.tc.TSC-low.quality: -100
The output nodes are defined as follows:
kern.timecounter.tc.X.mask is a bitmask, defining valid counter bits,
kern.timecounter.tc.X.counter is a present counter value,
kern.timecounter.tc.X.frequency is a counter update frequency,
kern.timecounter.tc.X.quality is an integral value, defining the quality of this time counter compared to others. A negative value means
this time counter is broken and should not be used.
The time management code of the kernel chooses one time counter from that list. The current choice can be read and affected via the
kern.timecounter.hardware tunable/sysctl.
SEE ALSO attimer(4), eventtimers(4), ffclock(4), hpet(4)BSD April 12, 2014 BSD