Very interesting shell scripting example.

This simple shell script will pick a random sentence from a text file. This is made up of multiple sentences from parts of the text file merged into one long sentence. words.sh1 2 3 4 5 #!/bin/sh   numwords=$(shuf -i 14-88 -n 1) words=$(shuf -n $numwords 122-0.txt | cut -d$”…

Read More

Read a file from the Internet directly into VIM.

The VI text editor is a very flexible text editor. This can read from STDIN, and this makes it very good to use in a script. But you can also read a file from the Internet. This works in concert with the wget utility. The wget -O- -q command reads…

Read More

How to properly call a function from a trigger in Arma 3.

Calling a function from a trigger in Arma 3 can be very tricky, this is how I managed to do it. commanderDead = { [’task2′,’SUCCEEDED’] call BIS_fnc_taskSetState; { _x setMarkerPos getPos house1; } forEach ["hqMarker", "hqCircle"]; [player, player, opfor, ["LOP_AFR_OPF_Infantry_IED","LOP_AFR_OPF_Infantry_Corpsman","LOP_AFR_OPF_Infantry_GL","LOP_AFR_OPF_Infantry_Rifleman_4","LOP_AFR_OPF_Infantry_Rifleman_4","LOP_AFR_OPF_Infantry_AR_Asst_2","LOP_AFR_OPF_Infantry_AT","LOP_AFR_OPF_Infantry_Rifleman_8","LOP_AFR_OPF_Infantry_Rifleman_5"], 16, 120] spawn BIS_fnc_spawnEnemy; private _attack = [] spawn KER_fnc_attackers;…

Read More