1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-15 01:24:29 +02:00

add ls tests for filenames with newline characters

This commit is contained in:
Kelly Brazil
2020-02-27 10:48:09 -08:00
parent 873b5ba8ac
commit ad61e6bc81
26 changed files with 607 additions and 142 deletions

View File

@ -0,0 +1 @@
[{"filename": "systemd-private-016de60725a3426792b93fc9f120b8f0-chronyd.service-oZqq4u", "parent": "."}, {"filename": "systemd-private-a30a5a178daa4042b42dfaf5ff9e5f68-chronyd.service-a1tpxv", "parent": "."}, {"filename": "systemd-private-af69d7360f3e40cfa947358c0fb5a6f8-chronyd.service-T3MQ4j", "parent": "."}, {"filename": "tmp.CvALl2jE6u", "parent": "."}, {"filename": "tmp.e7AlxSxY5a", "parent": "."}, {"filename": "tmp.uXm9yegjwj", "parent": "."}, {"filename": "a regular filename", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "a combination", "parent": "./lstest"}, {"filename": "of everything", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "a newline inside", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "four contiguous newlines inside", "parent": "./lstest"}, {"filename": "this file", "parent": "./lstest"}, {"filename": "has", "parent": "./lstest"}, {"filename": "six", "parent": "./lstest"}, {"filename": "newlines", "parent": "./lstest"}, {"filename": "within", "parent": "./lstest"}, {"filename": "this file starts with four newlines", "parent": "./lstest"}, {"filename": "this file starts with one newline", "parent": "./lstest"}]

View File

@ -0,0 +1,43 @@
.:
lstest
systemd-private-016de60725a3426792b93fc9f120b8f0-chronyd.service-oZqq4u
systemd-private-a30a5a178daa4042b42dfaf5ff9e5f68-chronyd.service-a1tpxv
systemd-private-af69d7360f3e40cfa947358c0fb5a6f8-chronyd.service-T3MQ4j
tmp.CvALl2jE6u
tmp.e7AlxSxY5a
tmp.uXm9yegjwj
./lstest:
a regular filename
this file has
a combination
of everything
this file has
a newline inside
this file has
four contiguous newlines inside
this file
has
six
newlines
within
this file starts with four newlines
this file starts with one newline

View File

@ -0,0 +1 @@
[{"filename": "a regular filename", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:12"}, {"filename": "\n\nthis file has\na combination\n\n\nof everything\n\n\n\n", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:17"}, {"filename": "this file has\na newline inside", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:14"}, {"filename": "this file has\n\n\n\nfour contiguous newlines inside", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:14"}, {"filename": "this file\nhas\nsix\n\nnewlines\n\nwithin", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:16"}, {"filename": "\n\n\n\nthis file starts with four newlines", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:40"}, {"filename": "\nthis file starts with one newline", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:13"}]

View File

@ -0,0 +1,34 @@
total 0
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:12 a regular filename
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:17
this file has
a combination
of everything
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:14 this file has
a newline inside
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:14 this file has
four contiguous newlines inside
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:16 this file
has
six
newlines
within
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:40
this file starts with four newlines
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:13
this file starts with one newline

View File

@ -0,0 +1 @@
[{"filename": "lstest", "parent": ".", "flags": "drwxrwxr-x.", "links": 2, "owner": "kbrazil", "group": "kbrazil", "size": 4096, "date": "Feb 22 00:40"}, {"filename": "systemd-private-016de60725a3426792b93fc9f120b8f0-chronyd.service-oZqq4u", "parent": ".", "flags": "drwx------.", "links": 3, "owner": "root", "group": "root", "size": 17, "date": "Feb 13 16:44"}, {"filename": "systemd-private-a30a5a178daa4042b42dfaf5ff9e5f68-chronyd.service-a1tpxv", "parent": ".", "flags": "drwx------.", "links": 3, "owner": "root", "group": "root", "size": 17, "date": "Feb 17 17:48"}, {"filename": "systemd-private-af69d7360f3e40cfa947358c0fb5a6f8-chronyd.service-T3MQ4j", "parent": ".", "flags": "drwx------.", "links": 3, "owner": "root", "group": "root", "size": 17, "date": "Feb 20 14:41"}, {"filename": "tmp.CvALl2jE6u", "parent": ".", "flags": "drwx------.", "links": 2, "owner": "root", "group": "root", "size": 6, "date": "Feb 13 16:44"}, {"filename": "tmp.e7AlxSxY5a", "parent": ".", "flags": "drwx------.", "links": 2, "owner": "root", "group": "root", "size": 6, "date": "Feb 20 14:41"}, {"filename": "tmp.uXm9yegjwj", "parent": ".", "flags": "drwx------.", "links": 2, "owner": "root", "group": "root", "size": 6, "date": "Feb 17 17:48"}, {"filename": "a regular filename", "parent": "./lstest", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:12"}, {"filename": "\n\nthis file has\na combination\n\n\nof everything\n\n\n\n", "parent": "./lstest", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:17"}, {"filename": "this file has\na newline inside", "parent": "./lstest", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:14"}, {"filename": "this file has\n\n\n\nfour contiguous newlines inside", "parent": "./lstest", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:14"}, {"filename": "this file\nhas\nsix\n\nnewlines\n\nwithin", "parent": "./lstest", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:16"}, {"filename": "\n\n\n\nthis file starts with four newlines", "parent": "./lstest", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:40"}, {"filename": "\nthis file starts with one newline", "parent": "./lstest", "flags": "-rw-rw-r--.", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 22 00:13"}]

View File

@ -0,0 +1,45 @@
.:
total 4
drwxrwxr-x. 2 kbrazil kbrazil 4096 Feb 22 00:40 lstest
drwx------. 3 root root 17 Feb 13 16:44 systemd-private-016de60725a3426792b93fc9f120b8f0-chronyd.service-oZqq4u
drwx------. 3 root root 17 Feb 17 17:48 systemd-private-a30a5a178daa4042b42dfaf5ff9e5f68-chronyd.service-a1tpxv
drwx------. 3 root root 17 Feb 20 14:41 systemd-private-af69d7360f3e40cfa947358c0fb5a6f8-chronyd.service-T3MQ4j
drwx------. 2 root root 6 Feb 13 16:44 tmp.CvALl2jE6u
drwx------. 2 root root 6 Feb 20 14:41 tmp.e7AlxSxY5a
drwx------. 2 root root 6 Feb 17 17:48 tmp.uXm9yegjwj
./lstest:
total 0
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:12 a regular filename
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:17
this file has
a combination
of everything
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:14 this file has
a newline inside
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:14 this file has
four contiguous newlines inside
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:16 this file
has
six
newlines
within
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:40
this file starts with four newlines
-rw-rw-r--. 1 kbrazil kbrazil 0 Feb 22 00:13
this file starts with one newline

View File

@ -0,0 +1 @@
[{"filename": "a regular filename"}, {"filename": "this file has"}, {"filename": "a combination"}, {"filename": "of everything"}, {"filename": "this file has"}, {"filename": "a newline inside"}, {"filename": "this file has"}, {"filename": "four contiguous newlines inside"}, {"filename": "this file"}, {"filename": "has"}, {"filename": "six"}, {"filename": "newlines"}, {"filename": "within"}, {"filename": "this file starts with four newlines"}, {"filename": "this file starts with one newline"}]

View File

@ -0,0 +1,33 @@
a regular filename
this file has
a combination
of everything
this file has
a newline inside
this file has
four contiguous newlines inside
this file
has
six
newlines
within
this file starts with four newlines
this file starts with one newline

View File

@ -40,6 +40,21 @@ ls -R /usr > ls-R.out
ls -alR /usr > ls-alR.out
ls /usr/* > ls-glob.out
cd /tmp/lstest
touch 'a regular filename'
touch $'\nthis file starts with one newline'
touch $'\n\n\n\nthis file starts with four newlines'
touch $'this file has\na newline inside'
touch $'this file has\n\n\n\nfour contiguous newlines inside'
touch $'this file\nhas\nsix\n\nnewlines\n\nwithin'
touch $'\n\nthis file has\na combination\n\n\nof everything\n\n\n\n'
cd /tmp
ls -R > ~/utils/ls-R-newlines.out
ls -lR > ~/utils/ls-lR-newlines.out
cd lstest
ls > ~/utils/ls-newlines.out
ls -l > ~/utils/ls-l-newlines.out
lsblk > lsblk.out
lsblk -o +KNAME,FSTYPE,LABEL,UUID,PARTLABEL,PARTUUID,RA,MODEL,SERIAL,STATE,OWNER,GROUP,MODE,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,RQ-SIZE,DISC-ALN,DISC-GRAN,DISC-MAX,DISC-ZERO,WSAME,WWN,RAND,PKNAME,HCTL,TRAN,REV,VENDOR > lsblk-allcols.out
lsmod > lsmod.out

View File

@ -0,0 +1 @@
[{"filename": "lstest"}, {"filename": "this file starts with four newlines", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "a combination", "parent": "./lstest"}, {"filename": "of everything", "parent": "./lstest"}, {"filename": "this file starts with one newline", "parent": "./lstest"}, {"filename": "a regular filename", "parent": "./lstest"}, {"filename": "this file", "parent": "./lstest"}, {"filename": "has", "parent": "./lstest"}, {"filename": "six", "parent": "./lstest"}, {"filename": "newlines", "parent": "./lstest"}, {"filename": "within", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "four contiguous newlines inside", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "a newline inside", "parent": "./lstest"}]

View File

@ -0,0 +1,36 @@
lstest
./lstest:
this file starts with four newlines
this file has
a combination
of everything
this file starts with one newline
a regular filename
this file
has
six
newlines
within
this file has
four contiguous newlines inside
this file has
a newline inside

View File

@ -0,0 +1 @@
[{"filename": "\n\n\n\nthis file starts with four newlines", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}, {"filename": "\n\nthis file has\na combination\n\n\nof everything\n\n\n\n", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}, {"filename": "\nthis file starts with one newline", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}, {"filename": "a regular filename", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}, {"filename": "this file\nhas\nsix\n\nnewlines\n\nwithin", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}, {"filename": "this file has\n\n\n\nfour contiguous newlines inside", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}, {"filename": "this file has\na newline inside", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}]

View File

@ -0,0 +1,34 @@
total 0
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19
this file starts with four newlines
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19
this file has
a combination
of everything
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19
this file starts with one newline
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19 a regular filename
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19 this file
has
six
newlines
within
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19 this file has
four contiguous newlines inside
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19 this file has
a newline inside

View File

@ -0,0 +1 @@
[{"filename": "lstest", "flags": "drwxr-xr-x", "links": 9, "owner": "kbrazil", "group": "staff", "size": 288, "date": "Feb 27 10:19"}, {"filename": "\n\n\n\nthis file starts with four newlines", "parent": "./lstest", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}, {"filename": "\n\nthis file has\na combination\n\n\nof everything\n\n\n\n", "parent": "./lstest", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}, {"filename": "\nthis file starts with one newline", "parent": "./lstest", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}, {"filename": "a regular filename", "parent": "./lstest", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}, {"filename": "this file\nhas\nsix\n\nnewlines\n\nwithin", "parent": "./lstest", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}, {"filename": "this file has\n\n\n\nfour contiguous newlines inside", "parent": "./lstest", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}, {"filename": "this file has\na newline inside", "parent": "./lstest", "flags": "-rw-r--r--", "links": 1, "owner": "kbrazil", "group": "staff", "size": 0, "date": "Feb 27 10:19"}]

View File

@ -0,0 +1,38 @@
total 0
drwxr-xr-x 9 kbrazil staff 288 Feb 27 10:19 lstest
./lstest:
total 0
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19
this file starts with four newlines
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19
this file has
a combination
of everything
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19
this file starts with one newline
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19 a regular filename
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19 this file
has
six
newlines
within
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19 this file has
four contiguous newlines inside
-rw-r--r-- 1 kbrazil staff 0 Feb 27 10:19 this file has
a newline inside

View File

@ -0,0 +1 @@
[{"filename": "this file starts with four newlines"}, {"filename": "this file has"}, {"filename": "a combination"}, {"filename": "of everything"}, {"filename": "this file starts with one newline"}, {"filename": "a regular filename"}, {"filename": "this file"}, {"filename": "has"}, {"filename": "six"}, {"filename": "newlines"}, {"filename": "within"}, {"filename": "this file has"}, {"filename": "four contiguous newlines inside"}, {"filename": "this file has"}, {"filename": "a newline inside"}]

View File

@ -1,151 +1,33 @@
total 584
-rw-r--r-- 1 kbrazil wheel 0 Feb 24 16:55
three newlines start this file
drwxr-xr-x 3 root wheel 96 Feb 24 12:13 MacAgent
-rw------- 1 root wheel 0 Feb 24 16:33 _Library_Application Support_Fortinet_FortiClient_data__vir_high
-rw------- 1 root wheel 0 Feb 24 16:33 _Library_Application Support_Fortinet_FortiClient_tmp_avsig_delata_vir_high
srwxr-xr-x 1 kbrazil wheel 0 Feb 20 14:41 centosserial
-rw-r--r-- 1 root wheel 382 Feb 20 14:41 centosserial.sh.log
drwx------ 3 kbrazil wheel 96 Feb 7 23:32 com.apple.launchd.ZRwqedKmO9
drwx------ 3 kbrazil wheel 96 Feb 7 23:32 com.apple.launchd.xPCDEP69Cl
srwxrwxrwx 1 kbrazil wheel 0 Feb 7 23:32 fctvpnctl.sock
srw------- 1 kbrazil wheel 0 Feb 7 23:32 fctvpnctl.sock_501
-rw-r--r-- 1 kbrazil wheel 0 Feb 24 16:58 ls-newlines.out
drwxr-xr-x 10 kbrazil wheel 320 Feb 24 16:58 lstest
srw-rw-rw- 1 root wheel 0 Feb 7 23:31 olisne-WY4G9IZafUNsloCollectorServicePipe
-rwx------ 1 root wheel 535 Feb 22 18:56 scriptcode.0JeYTA
-rwx------ 1 root wheel 531 Feb 22 19:19 scriptcode.0d9OX9
-rwx------ 1 root wheel 535 Feb 24 12:12 scriptcode.0jvSGh
-rwx------ 1 root wheel 3312 Feb 20 17:43 scriptcode.26L6Aw
-rwx------ 1 root wheel 311 Feb 22 18:56 scriptcode.2KJ0DB
-rwx------ 1 root wheel 316 Feb 21 18:10 scriptcode.3iQbCH
-rwx------ 1 root wheel 1068 Feb 21 18:10 scriptcode.47tsJK
-rwx------ 1 root wheel 316 Feb 24 12:12 scriptcode.5EGutx
-rwx------ 1 root wheel 279 Feb 24 12:12 scriptcode.73zg3m
-rwx------ 1 root wheel 920 Feb 22 19:19 scriptcode.7EKhVr
-rwx------ 1 root wheel 408 Feb 22 19:19 scriptcode.7XsHV0
-rwx------ 1 root wheel 531 Feb 20 17:43 scriptcode.7lVOvs
-rwx------ 1 root wheel 1068 Feb 20 17:43 scriptcode.AHABAG
-rwx------ 1 root wheel 316 Feb 20 17:43 scriptcode.CnQHRy
-rwx------ 1 root wheel 279 Feb 21 18:41 scriptcode.FEStzN
-rwx------ 1 root wheel 277 Feb 20 17:43 scriptcode.FY7cUj
-rwx------ 1 root wheel 1292 Feb 20 17:43 scriptcode.GY4L8Z
-rwx------ 1 root wheel 535 Feb 20 17:05 scriptcode.Gz2pae
-rwx------ 1 root wheel 311 Feb 21 18:09 scriptcode.GzIQzf
-rwx------ 1 root wheel 920 Feb 24 12:12 scriptcode.HPloGp
-rwx------ 1 root wheel 531 Feb 24 12:12 scriptcode.HtJdie
-rwx------ 1 root wheel 311 Feb 24 12:11 scriptcode.Ihm1Oo
-rwx------ 1 root wheel 277 Feb 22 19:19 scriptcode.IkV9ka
-rwx------ 1 root wheel 3312 Feb 24 12:12 scriptcode.KKN22F
-rwx------ 1 root wheel 279 Feb 24 12:12 scriptcode.Kx84Te
-rwx------ 1 root wheel 408 Feb 24 12:12 scriptcode.LyuE2u
-rwx------ 1 root wheel 400 Feb 21 18:41 scriptcode.N2AhIg
-rwx------ 1 root wheel 1208 Feb 24 12:12 scriptcode.Nqmmg7
-rwx------ 1 root wheel 3312 Feb 21 18:10 scriptcode.OHRPTO
-rwx------ 1 root wheel 277 Feb 24 12:12 scriptcode.OQCX7n
-rwx------ 1 root wheel 535 Feb 21 18:41 scriptcode.PoKNUA
-rwx------ 1 root wheel 531 Feb 22 19:19 scriptcode.R2XvfH
-rwx------ 1 root wheel 408 Feb 21 18:10 scriptcode.R4JK3n
-rwx------ 1 root wheel 1292 Feb 21 18:41 scriptcode.RgJYtc
-rwx------ 1 root wheel 531 Feb 20 17:43 scriptcode.SeUnOY
-rwx------ 1 root wheel 316 Feb 22 19:19 scriptcode.SmpfaH
-rwx------ 1 root wheel 1208 Feb 21 18:41 scriptcode.Sqk4gn
-rwx------ 1 root wheel 311 Feb 21 18:09 scriptcode.SxoG8F
-rwx------ 1 root wheel 531 Feb 24 12:12 scriptcode.ThENy0
-rwx------ 1 root wheel 311 Feb 22 18:56 scriptcode.TjBafP
-rwx------ 1 root wheel 279 Feb 20 17:43 scriptcode.VYNiW2
-rwx------ 1 root wheel 535 Feb 24 12:11 scriptcode.Yyqf85
-rwx------ 1 root wheel 535 Feb 22 19:19 scriptcode.aVTtu2
-rwx------ 1 root wheel 1208 Feb 20 17:43 scriptcode.czs9l6
-rwx------ 1 root wheel 920 Feb 20 17:43 scriptcode.eFVE3D
-rwx------ 1 root wheel 1292 Feb 24 12:12 scriptcode.f88eGZ
-rwx------ 1 root wheel 282 Feb 24 12:12 scriptcode.flB4nR
-rwx------ 1 root wheel 277 Feb 21 18:41 scriptcode.iMzN8Y
-rwx------ 1 root wheel 535 Feb 20 17:43 scriptcode.iPaXLd
-rwx------ 1 root wheel 279 Feb 21 18:41 scriptcode.jkaeC8
-rwx------ 1 root wheel 1292 Feb 22 19:19 scriptcode.k0Qc64
-rwx------ 1 root wheel 279 Feb 20 17:43 scriptcode.kH4nP3
-rwx------ 1 root wheel 282 Feb 20 17:43 scriptcode.l0Wcmj
-rwx------ 1 root wheel 311 Feb 24 12:11 scriptcode.lWzSJu
-rwx------ 1 root wheel 279 Feb 22 19:19 scriptcode.m1wgPP
-rwx------ 1 root wheel 1208 Feb 22 19:19 scriptcode.mG7NEw
-rwx------ 1 root wheel 531 Feb 21 18:41 scriptcode.mfGENQ
-rwx------ 1 root wheel 1068 Feb 24 12:12 scriptcode.n4urXg
-rwx------ 1 root wheel 535 Feb 21 18:09 scriptcode.n5Hn9m
-rwx------ 1 root wheel 282 Feb 21 18:10 scriptcode.nggGXs
-rwx------ 1 root wheel 400 Feb 24 12:12 scriptcode.obdjU7
-rwx------ 1 root wheel 1068 Feb 22 19:19 scriptcode.pIBQku
-rwx------ 1 root wheel 400 Feb 22 19:19 scriptcode.pmiMa5
-rwx------ 1 root wheel 400 Feb 20 17:43 scriptcode.qd2MtX
-rwx------ 1 root wheel 311 Feb 20 17:05 scriptcode.sF2VTO
-rwx------ 1 root wheel 920 Feb 21 18:41 scriptcode.sWaDJU
-rwx------ 1 root wheel 408 Feb 20 17:43 scriptcode.tb9thN
-rwx------ 1 root wheel 3312 Feb 22 19:19 scriptcode.v5rHnt
-rwx------ 1 root wheel 531 Feb 21 18:41 scriptcode.xSmYzD
-rwx------ 1 root wheel 311 Feb 20 17:05 scriptcode.xztElJ
-rwx------ 1 root wheel 282 Feb 22 19:19 scriptcode.z1R5gD
-rwx------ 1 root wheel 279 Feb 22 19:19 scriptcode.zPNZQP
drwx------ 3 kbrazil wheel 96 Feb 13 16:44 vmware-kbrazil
./MacAgent:
total 416
-rw-r--r-- 1 root wheel 211848 Feb 24 12:13 vulscanOut.xml
./com.apple.launchd.ZRwqedKmO9:
total 0
srw-rw-rw- 1 kbrazil wheel 0 Feb 7 23:32 Render
./com.apple.launchd.xPCDEP69Cl:
total 0
srw-rw-rw- 1 kbrazil wheel 0 Feb 7 23:32 Listeners
./lstest:
total 0
-rw-r--r-- 1 kbrazil wheel 0 Feb 24 16:58
combo of
this file starts with four newlines
this file has
a combination
of everything
this file starts with one newline
a regular filename
this file
has
six
newlines
inside
and trailing
this file
within
this file has
-rw-r--r-- 1 kbrazil wheel 0 Feb 24 16:55
three newlines start this file
-rw-r--r-- 1 kbrazil wheel 0 Feb 24 16:42
this file has a newline in the beginning
-rw-r--r-- 1 kbrazil wheel 0 Feb 24 14:56 another filename with
multiple
newline characters
-rw-r--r-- 1 kbrazil wheel 0 Feb 24 16:35 filename with
two newlines and two trailing newlines
-rw-r--r-- 1 kbrazil wheel 0 Feb 24 14:55 filename with a
newline character
-rw-r--r-- 1 kbrazil wheel 0 Feb 24 14:56 regularfile
-rw-r--r-- 1 kbrazil wheel 0 Feb 24 15:44 this filename has
four newlines in it
./vmware-kbrazil:
total 0
drwx------ 3 kbrazil wheel 96 Feb 20 14:41 mksctrl
./vmware-kbrazil/mksctrl:
total 0
srwxr-xr-x 1 kbrazil wheel 0 Feb 20 14:41 mksctrl-0000002818-000-39aec79d
four contiguous newlines inside
this file has
a newline inside

View File

@ -0,0 +1 @@
[{"filename": "systemd-private-65c1089f1d4c4cf5bc50ca55478abfde-systemd-resolved.service-La9AqY", "parent": "."}, {"filename": "systemd-private-65c1089f1d4c4cf5bc50ca55478abfde-systemd-timesyncd.service-L7q4cJ", "parent": "."}, {"filename": "vmware-root_670-2722828838", "parent": "."}, {"filename": "a regular filename", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "a combination", "parent": "./lstest"}, {"filename": "of everything", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "a newline inside", "parent": "./lstest"}, {"filename": "this file has", "parent": "./lstest"}, {"filename": "four contiguous newlines inside", "parent": "./lstest"}, {"filename": "this file", "parent": "./lstest"}, {"filename": "has", "parent": "./lstest"}, {"filename": "six", "parent": "./lstest"}, {"filename": "newlines", "parent": "./lstest"}, {"filename": "within", "parent": "./lstest"}, {"filename": "this file starts with four newlines", "parent": "./lstest"}, {"filename": "this file starts with one newline", "parent": "./lstest"}]

View File

@ -0,0 +1,40 @@
.:
lstest
systemd-private-65c1089f1d4c4cf5bc50ca55478abfde-systemd-resolved.service-La9AqY
systemd-private-65c1089f1d4c4cf5bc50ca55478abfde-systemd-timesyncd.service-L7q4cJ
vmware-root_670-2722828838
./lstest:
a regular filename
this file has
a combination
of everything
this file has
a newline inside
this file has
four contiguous newlines inside
this file
has
six
newlines
within
this file starts with four newlines
this file starts with one newline

View File

@ -0,0 +1 @@
[{"filename": "a regular filename", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}, {"filename": "\n\nthis file has\na combination\n\n\nof everything\n\n\n\n", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}, {"filename": "this file has\na newline inside", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}, {"filename": "this file has\n\n\n\nfour contiguous newlines inside", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}, {"filename": "this file\nhas\nsix\n\nnewlines\n\nwithin", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}, {"filename": "\n\n\n\nthis file starts with four newlines", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}, {"filename": "\nthis file starts with one newline", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}]

View File

@ -0,0 +1,34 @@
total 0
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08 a regular filename
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08
this file has
a combination
of everything
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08 this file has
a newline inside
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08 this file has
four contiguous newlines inside
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08 this file
has
six
newlines
within
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08
this file starts with four newlines
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08
this file starts with one newline

View File

@ -0,0 +1 @@
[{"filename": "lstest", "parent": ".", "flags": "drwxrwxr-x", "links": 2, "owner": "kbrazil", "group": "kbrazil", "size": 4096, "date": "Feb 27 18:08"}, {"filename": "systemd-private-65c1089f1d4c4cf5bc50ca55478abfde-systemd-resolved.service-La9AqY", "parent": ".", "flags": "drwx------", "links": 3, "owner": "root", "group": "root", "size": 4096, "date": "Feb 27 18:07"}, {"filename": "systemd-private-65c1089f1d4c4cf5bc50ca55478abfde-systemd-timesyncd.service-L7q4cJ", "parent": ".", "flags": "drwx------", "links": 3, "owner": "root", "group": "root", "size": 4096, "date": "Feb 27 18:07"}, {"filename": "vmware-root_670-2722828838", "parent": ".", "flags": "drwx------", "links": 2, "owner": "root", "group": "root", "size": 4096, "date": "Feb 27 18:07"}, {"filename": "a regular filename", "parent": "./lstest", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}, {"filename": "\n\nthis file has\na combination\n\n\nof everything\n\n\n\n", "parent": "./lstest", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}, {"filename": "this file has\na newline inside", "parent": "./lstest", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}, {"filename": "this file has\n\n\n\nfour contiguous newlines inside", "parent": "./lstest", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}, {"filename": "this file\nhas\nsix\n\nnewlines\n\nwithin", "parent": "./lstest", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}, {"filename": "\n\n\n\nthis file starts with four newlines", "parent": "./lstest", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}, {"filename": "\nthis file starts with one newline", "parent": "./lstest", "flags": "-rw-rw-r--", "links": 1, "owner": "kbrazil", "group": "kbrazil", "size": 0, "date": "Feb 27 18:08"}]

View File

@ -0,0 +1,42 @@
.:
total 16
drwxrwxr-x 2 kbrazil kbrazil 4096 Feb 27 18:08 lstest
drwx------ 3 root root 4096 Feb 27 18:07 systemd-private-65c1089f1d4c4cf5bc50ca55478abfde-systemd-resolved.service-La9AqY
drwx------ 3 root root 4096 Feb 27 18:07 systemd-private-65c1089f1d4c4cf5bc50ca55478abfde-systemd-timesyncd.service-L7q4cJ
drwx------ 2 root root 4096 Feb 27 18:07 vmware-root_670-2722828838
./lstest:
total 0
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08 a regular filename
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08
this file has
a combination
of everything
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08 this file has
a newline inside
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08 this file has
four contiguous newlines inside
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08 this file
has
six
newlines
within
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08
this file starts with four newlines
-rw-rw-r-- 1 kbrazil kbrazil 0 Feb 27 18:08
this file starts with one newline

View File

@ -0,0 +1 @@
[{"filename": "a regular filename"}, {"filename": "this file has"}, {"filename": "a combination"}, {"filename": "of everything"}, {"filename": "this file has"}, {"filename": "a newline inside"}, {"filename": "this file has"}, {"filename": "four contiguous newlines inside"}, {"filename": "this file"}, {"filename": "has"}, {"filename": "six"}, {"filename": "newlines"}, {"filename": "within"}, {"filename": "this file starts with four newlines"}, {"filename": "this file starts with one newline"}]

View File

@ -0,0 +1,33 @@
a regular filename
this file has
a combination
of everything
this file has
a newline inside
this file has
four contiguous newlines inside
this file
has
six
newlines
within
this file starts with four newlines
this file starts with one newline

View File

@ -73,6 +73,42 @@ class MyTests(unittest.TestCase):
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ls-glob.out'), 'r') as f:
self.osx_10_14_6_ls_glob = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ls-R-newlines.out'), 'r') as f:
self.centos_7_7_ls_R_newlines = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ls-R-newlines.out'), 'r') as f:
self.ubuntu_18_4_ls_R_newlines = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ls-R-newlines.out'), 'r') as f:
self.osx_10_14_6_ls_R_newlines = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ls-l-newlines.out'), 'r') as f:
self.centos_7_7_ls_l_newlines = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ls-l-newlines.out'), 'r') as f:
self.ubuntu_18_4_ls_l_newlines = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ls-l-newlines.out'), 'r') as f:
self.osx_10_14_6_ls_l_newlines = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ls-lR-newlines.out'), 'r') as f:
self.centos_7_7_ls_lR_newlines = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ls-lR-newlines.out'), 'r') as f:
self.ubuntu_18_4_ls_lR_newlines = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ls-lR-newlines.out'), 'r') as f:
self.osx_10_14_6_ls_lR_newlines = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ls-newlines.out'), 'r') as f:
self.centos_7_7_ls_newlines = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ls-newlines.out'), 'r') as f:
self.ubuntu_18_4_ls_newlines = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ls-newlines.out'), 'r') as f:
self.osx_10_14_6_ls_newlines = f.read()
# output
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ls.json'), 'r') as f:
self.centos_7_7_ls_json = json.loads(f.read())
@ -137,6 +173,42 @@ class MyTests(unittest.TestCase):
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ls-glob.json'), 'r') as f:
self.osx_10_14_6_ls_glob_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ls-R-newlines.json'), 'r') as f:
self.centos_7_7_ls_R_newlines_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ls-R-newlines.json'), 'r') as f:
self.ubuntu_18_4_ls_R_newlines_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ls-R-newlines.json'), 'r') as f:
self.osx_10_14_6_ls_R_newlines_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ls-l-newlines.json'), 'r') as f:
self.centos_7_7_ls_l_newlines_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ls-l-newlines.json'), 'r') as f:
self.ubuntu_18_4_ls_l_newlines_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ls-l-newlines.json'), 'r') as f:
self.osx_10_14_6_ls_l_newlines_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ls-lR-newlines.json'), 'r') as f:
self.centos_7_7_ls_lR_newlines_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ls-lR-newlines.json'), 'r') as f:
self.ubuntu_18_4_ls_lR_newlines_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ls-lR-newlines.json'), 'r') as f:
self.osx_10_14_6_ls_lR_newlines_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/ls-newlines.json'), 'r') as f:
self.centos_7_7_ls_newlines_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/ls-newlines.json'), 'r') as f:
self.ubuntu_18_4_ls_newlines_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/ls-newlines.json'), 'r') as f:
self.osx_10_14_6_ls_newlines_json = json.loads(f.read())
def test_ls_centos_7_7(self):
"""
Test plain 'ls /' on Centos 7.7
@ -263,6 +335,78 @@ class MyTests(unittest.TestCase):
"""
self.assertEqual(jc.parsers.ls.parse(self.osx_10_14_6_ls_glob, quiet=True), self.osx_10_14_6_ls_glob_json)
def test_ls_R_newlines_centos_7_7(self):
"""
Test 'ls -R' for filenames with newline characters on Centos 7.7
"""
self.assertEqual(jc.parsers.ls.parse(self.centos_7_7_ls_R_newlines, quiet=True), self.centos_7_7_ls_R_newlines_json)
def test_ls_R_newlines_ubuntu_18_4(self):
"""
Test 'ls -R' for filenames with newline characters on Ubuntu 18.4
"""
self.assertEqual(jc.parsers.ls.parse(self.ubuntu_18_4_ls_R_newlines, quiet=True), self.ubuntu_18_4_ls_R_newlines_json)
def test_ls_R_newlines_osx_10_14_6(self):
"""
Test 'ls -R' for filenames with newline characters on OSX 10.14.6
"""
self.assertEqual(jc.parsers.ls.parse(self.osx_10_14_6_ls_R_newlines, quiet=True), self.osx_10_14_6_ls_R_newlines_json)
def test_ls_l_newlines_centos_7_7(self):
"""
Test 'ls -l' for filenames with newline characters on Centos 7.7
"""
self.assertEqual(jc.parsers.ls.parse(self.centos_7_7_ls_l_newlines, quiet=True), self.centos_7_7_ls_l_newlines_json)
def test_ls_l_newlines_ubuntu_18_4(self):
"""
Test 'ls -l' for filenames with newline characters on Ubuntu 18.4
"""
self.assertEqual(jc.parsers.ls.parse(self.ubuntu_18_4_ls_l_newlines, quiet=True), self.ubuntu_18_4_ls_l_newlines_json)
def test_ls_l_newlines_osx_10_14_6(self):
"""
Test 'ls -l' for filenames with newline characters on OSX 10.14.6
"""
self.assertEqual(jc.parsers.ls.parse(self.osx_10_14_6_ls_l_newlines, quiet=True), self.osx_10_14_6_ls_l_newlines_json)
def test_ls_lR_newlines_centos_7_7(self):
"""
Test 'ls -lR' for filenames with newline characters on Centos 7.7
"""
self.assertEqual(jc.parsers.ls.parse(self.centos_7_7_ls_lR_newlines, quiet=True), self.centos_7_7_ls_lR_newlines_json)
def test_ls_lR_newlines_ubuntu_18_4(self):
"""
Test 'ls -lR' for filenames with newline characters on Ubuntu 18.4
"""
self.assertEqual(jc.parsers.ls.parse(self.ubuntu_18_4_ls_lR_newlines, quiet=True), self.ubuntu_18_4_ls_lR_newlines_json)
def test_ls_lR_newlines_osx_10_14_6(self):
"""
Test 'ls -lR' for filenames with newline characters on OSX 10.14.6
"""
self.assertEqual(jc.parsers.ls.parse(self.osx_10_14_6_ls_lR_newlines, quiet=True), self.osx_10_14_6_ls_lR_newlines_json)
def test_ls_newlines_centos_7_7(self):
"""
Test 'ls' for filenames with newline characters on Centos 7.7
"""
self.assertEqual(jc.parsers.ls.parse(self.centos_7_7_ls_newlines, quiet=True), self.centos_7_7_ls_newlines_json)
def test_ls_newlines_ubuntu_18_4(self):
"""
Test 'ls' for filenames with newline characters on Ubuntu 18.4
"""
self.assertEqual(jc.parsers.ls.parse(self.ubuntu_18_4_ls_newlines, quiet=True), self.ubuntu_18_4_ls_newlines_json)
def test_ls_newlines_osx_10_14_6(self):
"""
Test 'ls' for filenames with newline characters on OSX 10.14.6
"""
self.assertEqual(jc.parsers.ls.parse(self.osx_10_14_6_ls_newlines, quiet=True), self.osx_10_14_6_ls_newlines_json)
if __name__ == '__main__':
unittest.main()