Tiny Core Linux
dCore Import Debian Packages to Mountable SCE extensions => dCore X86 => dCore x86 Imported Extensions => Topic started by: Jason W on February 17, 2018, 10:03:34 PM
-
I have modified ~/.xinitrc in the Xtc package to execute the scripts in ~/.X.d in order of the starting characters being numbers first, then letters. So if you want a script to run last, it could be named for example zzzsettime to run last, or aaasoundsetup to run first. Scripts starting with numbers will run before those starting with letters and will run in numerical order. This allows control of the executing order of ~/.X.d/ scripts.
~/.xinitrc is probably in your backup and would need to be removed from it to see this change upon update of Xtc.
MODIFIED: Spelling
-
Hi Jason W
... Scripts starting with numbers will run before those starting with letters and will run in numerical order. ...
Is this a true numerical sort or are you using an alphanumerical sort? I ask because unless numbers are padded with leading
zeros to make them all the same width, an alphanumerical sort will do this:
tc@box:~$ cat 123
1a
1A
11a
11A
12
tc@box:~$ cat 123 | sort
11A
11a
12
1A
1a
tc@box:~$
-
Here is the results of the order of files you mentioned -
1/11a
1/11A
1/12
1/1a
1/1A
It is the sort command run on the ~/.X.d/ scripts
-
Hi Jason W
So to prevent things like 11A and 12A from executing before 1A, one should ensure the numeric field is the same width
on all filenames.
-
Hi Rich.
'sort -V' produces the below result which seems more what folks would expect. I will use it in place of 'sort'.
1A
1a
11A
11a
12
AAA
ZZ
aaax
zzzx
-
Hi Jason W
Is the default in dCore GNU sort or busybox sort? If it's busybox sort, then the -g option looks like it will work for this use too:
tc@box:~$ cat 123
12
1a
11a
1A
11A
tc@box:~$ cat 123 | busybox sort -g
1A
1a
11A
11a
12
tc@box:~$
-
Oops, it's busybox. Actually, 'busybox sort -dn' gives a goog output also.
jason@box:~/1$ /bb/find | /bb/sort -dn
.
./AAA
./B
./B1
./B12
./B123
./ZZ
./a1
./a10
./a11
./aaax
./zzzx
./1A
./1a
./11A
./11a
./12
jason@box:~/1$
'busybox sort -g' gives me the following:
jason@box:~/1$ /bb/find | /bb/sort -g
.
./11A
./11a
./12
./1A
./1a
./AAA
./B
./B1
./B12
./B123
./ZZ
./a1
./a10
./a11
./aaax
./zzzx
jason@box:~/1$
-
Hi Jason W
I guess my version of busybox sort -g just works better than yours. :) At any rate, looks good.
-
Hi Jason W
Interesting. Using your list I get the same result:
tc@box:~$ cat 123 | sort -g
./11A
./11a
./12
./1A
./1a
./AAA
./B
./B1
./B12
./B123
./ZZ
./a1
./a10
./a11
tc@box:~$
However, if I remove the leading ./ from the entries, I get the correct result:
tc@box:~$ cat 123 | sort -g
AAA
B
B1
B12
B123
ZZ
a1
a10
a11
1A
1a
11A
11a
12
tc@box:~$
-
Hi Rich. You are right, when I use busybox find and "sort -g" I get the right order if I use the command as it basically is in .xinitrc and I think that should work.
jason$ /bb/find /home/jason/.X.d/ -type f -print | /bb/sort -g
/home/jason/.X.d/1
/home/jason/.X.d/10
/home/jason/.X.d/100
/home/jason/.X.d/1000
/home/jason/.X.d/10A
/home/jason/.X.d/10B
/home/jason/.X.d/10a
/home/jason/.X.d/10b
/home/jason/.X.d/12
/home/jason/.X.d/123
/home/jason/.X.d/321
/home/jason/.X.d/4
/home/jason/.X.d/5
/home/jason/.X.d/55
/home/jason/.X.d/AA
/home/jason/.X.d/ZZ
/home/jason/.X.d/aa
/home/jason/.X.d/aaaastartupsound
/home/jason/.X.d/df
/home/jason/.X.d/mouse
/home/jason/.X.d/pulseaudio
/home/jason/.X.d/time
/home/jason/.X.d/wbar
/home/jason/.X.d/xrandr
/home/jason/.X.d/xterm
/home/jason/.X.d/zz
/home/jason/.X.d/zzrollup
jason$
-
Hi
I propose to not execute scripts in ~/.X.d/ which terminates with ~
-
Ok, sounds useful. I think also not executing those that end in .bak, that is what I name my backup files.
-
Done and uploaded, please test.