Unix/ls: Difference between revisions

add RPL
(add RPL)
Line 1,482:
4
</pre>
 
=={{header|RPL}}==
The <code>VARS</code> returns all the files and folders in the current directory, but not sorted.
A few additional words are then needed to turn names into strings, sort the strings and come back to names.
≪ VARS LIST→ → len
≪ 1 len '''FOR''' n →STR len ROLL '''NEXT'''
len 1 '''FOR''' n
1 n 1 - '''START'''
'''IF''' DUP2 > '''THEN''' SWAP '''END''' n ROLLD '''NEXT'''
n ROLLD -1 STEP
1 len '''FOR''' n STR→ len ROLL '''NEXT'''
len →LIST
≫ ≫ ‘'''LS'''’ STO
 
=={{header|Ruby}}==
1,150

edits