Unexpected String in the middle of Returned JSON (from cURL users)

mmtscn
Community Explorer

Hi, I used the ShellScript cURL method to get a list of the users in the course.

 

This is my script:

 

curl <https://$schoolname.instructure.com/api/v1/courses/$MyCourseID/users \
-X GET \
-d per_page=100 \
-d enrollment_type[]=student \
-H "Authorization: Bearer $MyToken"

 

 

I get the returned string, formatted as

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100    38    0     0  100    38      0     39 --:--:-- --:--:-- --:--:--    38[{"id":2766,"name":"C A","created_at":"2016-09-14T18:39:02-04:00","sortable_name":"A, B ","short_name":"B A","sis_user_id":"218850","integration_id":null,"login_id":"ca50","email":"ca50@aaa.edu"},
...
...
{"id":29909,"name":"K J                       ","created_at":"2020-03-09T10:00:04-04:00
100 29977    0 29939  100    38  27876     35  0:00:01  0:00:","sortable_name":"J, W","short_name":"W J                       ","sis_user_id":"235251","integration_id":null,"login_id":"kj51","email":"kj51@aaa.edu"},
...
...
...
{"id":451,"name":"C R","created_at":"2016-09-14T18:34:35-04:00","sortable_name":"R, C","short_name":"C R","sis_user_id":"185511","integration_id":null,"login_id":"CR11","email":"cr@aaa.edu"}]01 --:--:-- 27911

 

But there is an expected string in the middle.

 

100 29977    0 29939  100    38  27876     35  0:00:01  0:00:

 

 

It begins with a carriage return "\r".

It is more visible in BBEdit (shwon as an upside down question mark "?"):

mmtscn_0-1613513257483.png

What is the cause of it and how can I get rid of it?

Thanks!

Labels (1)
0 Likes