Search found 4853 matches
- Fri 23 Feb 2018, 05:49
- Forum: Programming
- Topic: A simple way to detect an odd or even number in bash
- Replies: 25
- Views: 5668
- Fri 23 Feb 2018, 03:09
- Forum: Programming
- Topic: A simple way to detect an odd or even number in bash
- Replies: 25
- Views: 5668
for a non bashism version (as long as parameters don't contain spaces)MochiMoppel wrote:For a bullet proof check this should do:Code: Select all
[[ $N =~ ^-?[0-9]+$ ]] || exec echo $N is not an integer
Code: Select all
isnumber() [[ $(($1+0)) = ${1} ]]
- Fri 23 Feb 2018, 02:44
- Forum: Programming
- Topic: A simple way to detect an odd or even number in bash
- Replies: 25
- Views: 5668
- Thu 22 Feb 2018, 23:42
- Forum: Programming
- Topic: A simple way to detect an odd or even number in bash
- Replies: 25
- Views: 5668
- Thu 22 Feb 2018, 10:34
- Forum: Programming
- Topic: A simple way to detect an odd or even number in bash
- Replies: 25
- Views: 5668
For any language with bitwise operations (like bash), just use &1; however, posix shell lacks bitwise ops, so you need to use the modulus operator %
Code: Select all
iseven() [[ $(($1%2)) = 0 ]]
isodd() [[ $(($1%2)) = 1 ]]
- Fri 16 Feb 2018, 00:46
- Forum: Programming
- Topic: Unbloated coding resources
- Replies: 56
- Views: 81205
Here are github projects to replace larger versions:
pulseaudio
systemd
logind
udev
libevent
alsa
x11
xserver
glibc over musl
pulseaudio
systemd
logind
udev
libevent
alsa
x11
xserver
glibc over musl
- Fri 16 Feb 2018, 00:45
- Forum: Programming
- Topic: Unbloated coding resources
- Replies: 56
- Views: 81205
- Thu 01 Feb 2018, 19:42
- Forum: Programming
- Topic: init from the kernel side -- s243a's legacy bumbling.
- Replies: 3
- Views: 1708
- Thu 01 Feb 2018, 01:31
- Forum: Programming
- Topic: init from the kernel side -- s243a's legacy bumbling.
- Replies: 3
- Views: 1708
The kernel code is actually pretty easy to read, check out kernel_init in https://git.kernel.org/pub/scm/linux/ke ... .c?h=v4.15
- Thu 01 Feb 2018, 01:26
- Forum: Programming
- Topic: GUI dialog tool and serial IO (Solved)
- Replies: 6
- Views: 3800
- Thu 01 Feb 2018, 01:15
- Forum: Truly off-topic conversations
- Topic: U.S. tax code
- Replies: 18
- Views: 453
- Wed 31 Jan 2018, 23:43
- Forum: Programming
- Topic: Unbloated coding resources
- Replies: 56
- Views: 81205
smaller alternative to tinyX http://galos.no-ip.org/siX Good morning ,do you have the file ? I think galos is offline. Sorry for the late reply. The copy of siX that I had, does not include a license, so I can' repost it, but I did find some info here: http://betteros.org/tut/graphics1.php Its actu...
- Fri 22 Dec 2017, 12:14
- Forum: Browsers and Internet
- Topic: How about Basilisk (experimental) browser?
- Replies: 14
- Views: 4416
- Fri 08 Dec 2017, 03:19
- Forum: Puppy Derivatives
- Topic: Quirky Pyro64 version 0.6 (alpha) -- and Pyro32 0.5
- Replies: 212
- Views: 82604
I tried to get the samba server to be recognized by a second computer and it still fails to connect. Has anybody succeeded ? __________________________________________________ It is about time that I actually used samba myself! I am going to install Open Media Vault, have downloaded the iso. This i...
- Wed 06 Dec 2017, 17:55
- Forum: Cutting edge
- Topic: Linux on Intel Management Engine?
- Replies: 3
- Views: 2605
- Tue 05 Dec 2017, 03:54
- Forum: Puppy Derivatives
- Topic: Quirky Pyro64 version 0.6 (alpha) -- and Pyro32 0.5
- Replies: 212
- Views: 82604
Yes, I found that source yesterday, waitforX.c: https://sourceforge.net/projects/tinycoremeta4s/files/source/tinycorelinux/3.x/release/src/ Here is a shell function to replace waitforX waitforX(){ while ([ ! -S /tmp/.X11-unix/X0 ]) do sleep .1;done } On second though, if you run multiple Xservers t...
- Tue 05 Dec 2017, 00:55
- Forum: Cutting edge
- Topic: Linux on Intel Management Engine?
- Replies: 3
- Views: 2605
Linux on Intel Management Engine?
If you haven't heard about Intel ME, its basically a backdoor built into newer Intel chips with Minix built in to on chip programmable persistent memory (I'm not sure what type) Intel presumably used Minix due to Linux's GPL license and the relative size of Minix vs the various BSDs, but if we were ...
- Mon 04 Dec 2017, 23:54
- Forum: Puppy Derivatives
- Topic: Quirky Pyro64 version 0.6 (alpha) -- and Pyro32 0.5
- Replies: 212
- Views: 82604
strange you mention the blank screen with blinking cursor....I am experiencing this with new builds of Xenialpup 32 bit built with woof-CE testing recently. nothing is responsive but when power button is pressed the test sound is played (similar to woof-woof) no noticeable errors and does it also w...
- Mon 04 Dec 2017, 17:55
- Forum: Puppy Derivatives
- Topic: Quirky Pyro64 version 0.6 (alpha) -- and Pyro32 0.5
- Replies: 212
- Views: 82604
- Mon 04 Dec 2017, 03:37
- Forum: Puppy Derivatives
- Topic: Quirky Pyro64 version 0.6 (alpha) -- and Pyro32 0.5
- Replies: 212
- Views: 82604
Yeah, that blinking cursor on blank screen is odd, I have sometimes got that too. JWM must be running. I have asked Joe, the author of jwm, for any thoughts on that. I am using jwm 2.3.7, which has at least two bugs, that I have informed Joe about. I wonder if get that blank screen if I roll jwm ba...