This thread today reminded me of it: Larger window
This is OSX 10.13.6 and greater centric only.
This expands the terminal window on the fly in bash.
You initially need to put the standard terminal window to the top left hand side as far as it goes.
I wrote this for my 19 month old grandson, (17-06-2018), as he loves punching the computer keyboard.
It is a simple keyboard plaything that prints a coloured squared in a random position inside an expanded terminal window. The window size is for a MBP 13 inch device so that is the reason for the odd terminal size.
If the first argument is set to [Yy] then a single alpha-numeric character is spoken so little one can learn said characters as well as printing the random coloured square. If the second argument is set to [Yy] then you can write a sentance of not more than 40 characters to aid in speech learning also with the random coloured square.
If there are no arguments then just the random coloured square is generated per keystroke.
Have fun little ones.
I have been troubleshooting a mysterious performance problem with the nightly batch programs on our primary system for quite some time and just found something very interesting. All batch processes are running with a nice value of 24. I don't know what the default is on other systems but I do know... (3 Replies)
i have content that looks like this:
0003326050 A E LITHO
0023823422 AMERICAN RED CROSS
0005713642 ARUP LABORATORIES
0003206450 CAEL
0002519930 CARDINAL HEALTH
0002619063 FISHER HEALTHCAR
0065203177 OWENS & MINOR INC
0016552938 STAPLES INC
0000002001 MSC... (8 Replies)
Hi
I would like to test for a max number value. It may be a decimal so I know I have to pipe into bc.
I just cannot get the syntax for this to work. I cannot get passed an error with the bracket - see below.
Any help appreciated.
Regards
Ewan
This works:
/export/home/ewan> cat... (5 Replies)
Hello All,
I am trying to come up with a shell script to count a specific word in a logfile on each day of this month, last month and the month before. I need to produce this report and email it to customer.
Any ideas would be appreciated! (5 Replies)
Hi,
I have a script that accepts an input date from the user in yyyy-mm-dd format.
I need to get the mm-dd part and convert it to month name.
example:
2011-11-15
I want that to become "Nov 15"
I don't have the GNU date, I am using an AIX os.
Thanks. (1 Reply)
Hello,
i`m looking for some way to add to some date an partial number of months, for example to 2015y 02m 27d + 2,54m
i need to write this script in php or bash or sh or mysql or perl in normal time o unix time
i`m asking or there are any simple way to add partial number of month to some... (14 Replies)
Hi,
I need all file names in a folder which has date >= 10th of last month,
Example
: files in folder
AUTO_F1_20140610.TXT
BUTO_F1_20140616.TXT
CUTO_F1_20140603.TXT
FA_AUTO_06012014.TXT
LA_AUTO_06112014.TXT
MA_AUTO_06212014.TXT
ZA_AUTO_06232014.TXT
Output:
AUTO_F1_20140610.TXT... (9 Replies)
Dear Masters,
I need to eliminate lines from file input 2 when the date in column 1 more than date in column 1 in file input 1
input 1
20141101|USA|CANSEL|496420000
20141101|USA|CANUT|1069740000
20141101|USA|CANTENG|625920000
20141102|USA|CANUT|413180000
20141103|USA|CANSEL|1364245000... (5 Replies)
Discussion started by: radius
5 Replies
LEARN ABOUT BSD
initstate
RANDOM(3) Library Functions Manual RANDOM(3)NAME
random, srandom, initstate, setstate - better random number generator; routines for changing generators
SYNOPSIS
long random()
srandom(seed)
int seed;
char *initstate(seed, state, n)
unsigned seed;
char *state;
int n;
char *setstate(state)
char *state;
DESCRIPTION
Random uses a non-linear additive feedback random number generator employing a default table of size 31 long integers to return successive
pseudo-random numbers in the range from 0 to (2**31)-1. The period of this random number generator is very large, approximately
16*((2**31)-1).
Random/srandom have (almost) the same calling sequence and initialization properties as rand/srand. The difference is that rand(3) pro-
duces a much less random sequence -- in fact, the low dozen bits generated by rand go through a cyclic pattern. All the bits generated by
random are usable. For example, ``random()&01'' will produce a random binary value.
Unlike srand, srandom does not return the old seed; the reason for this is that the amount of state information used is much more than a
single word. (Two other routines are provided to deal with restarting/changing random number generators). Like rand(3), however, random
will by default produce a sequence of numbers that can be duplicated by calling srandom with 1 as the seed.
The initstate routine allows a state array, passed in as an argument, to be initialized for future use. The size of the state array (in
bytes) is used by initstate to decide how sophisticated a random number generator it should use -- the more state, the better the random
numbers will be. (Current "optimal" values for the amount of state information are 8, 32, 64, 128, and 256 bytes; other amounts will be
rounded down to the nearest known amount. Using less than 8 bytes will cause an error). The seed for the initialization (which specifies
a starting point for the random number sequence, and provides for restarting at the same point) is also an argument. Initstate returns a
pointer to the previous state information array.
Once a state has been initialized, the setstate routine provides for rapid switching between states. Setstate returns a pointer to the
previous state array; its argument state array is used for further random number generation until the next call to initstate or setstate.
Once a state array has been initialized, it may be restarted at a different point either by calling initstate (with the desired seed, the
state array, and its size) or by calling both setstate (with the state array) and srandom (with the desired seed). The advantage of call-
ing both setstate and srandom is that the size of the state array does not have to be remembered after it is initialized.
With 256 bytes of state information, the period of the random number generator is greater than 2**69 which should be sufficient for most
purposes.
AUTHOR
Earl T. Cohen
DIAGNOSTICS
If initstate is called with less than 8 bytes of state information, or if setstate detects that the state information has been garbled,
error messages are printed on the standard error output.
SEE ALSO rand(3)BUGS
About 2/3 the speed of rand(3C).
4.2 Berkeley Distribution September 29, 1985 RANDOM(3)