Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
slsh /
examples /
[ HOME SHELL ]
Name
Size
Permission
Action
assoc.sl
1.05
KB
-rw-r--r--
colormap.sl
478
B
-rw-r--r--
life.sl
2.15
KB
-rw-r--r--
prime.sl
853
B
-rwxr-xr-x
saveobj.sl
13.64
KB
-rw-r--r--
slsmgex2.sl
486
B
-rw-r--r--
sort.sl
1.5
KB
-rwxr-xr-x
utmp.sl
1.5
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : sort.sl
#! /usr/bin/env slsh % This program presents the solution to a problem posed by % Tom Christiansen <tchrist@mox.perl.com>. The problem reads: % % Sort an input file that consists of lines like this % % var1=23 other=14 ditto=23 fred=2 % % such that each output line is sorted WRT to the number. Order % of output lines does not change. Resolve collisions using the % variable name. e.g. % % fred=2 other=14 ditto=23 var1=23 % % Lines may be up to several kilobytes in length and contain % zillions of variables. %--------------------------------------------------------------------------- % % The solution presented below works by breaking up the line into an % array of alternating keywords and values with the keywords as the even % elements and the values as the odd. It is about 30% faster than the % python solution. private variable Keys, Values; private define sort_fun (i, j) { variable s, a, b; s = Values[i] - Values[j]; !if (s) return strcmp (Keys[i], Keys[j]); return s; } define slsh_main () { variable line, len, i, vals; foreach line (stdin) { line = strtok (line, " \t\n="); len = length(line)/2; if (len == 0) continue; % Even elements are keys, odd are values Keys = line[[0::2]]; vals = line[[1::2]]; Values = atoi (vals); i = array_sort ([0:len-1], &sort_fun); % There are different ways of writing the result. Here is a % fast way that avoids a loop. () = printf ("%s\n", strjoin (Keys[i] + "=" + vals[i], " ")); } }
Close