diff --git a/doc/devices.md b/doc/devices.md index 2e2de908..ad4ef430 100644 --- a/doc/devices.md +++ b/doc/devices.md @@ -55,7 +55,7 @@ Reading the real time clock (RTC): Changing the system time: ``` -> print "2025-01-01 00:00:00" => /dev/clk/rtc +> print 2025-01-01 00:00:00 => /dev/clk/rtc [580.327629] RTC 2025-01-01 00:00:00 +0000 ``` diff --git a/doc/manual.md b/doc/manual.md index 6ad1caf1..e13a6d94 100644 --- a/doc/manual.md +++ b/doc/manual.md @@ -270,7 +270,7 @@ You can print the date with `date`: You can update the real time clock by writing the correct time to its device file: - > print "2023-03-21 10:00:00" => /dev/clk/rtc + > print 2023-03-21 10:00:00 => /dev/clk/rtc > date 2023-03-21 10:00:00 +0000 diff --git a/src/bin/print.rs b/src/bin/print.rs index 8d190d94..2296d6fb 100644 --- a/src/bin/print.rs +++ b/src/bin/print.rs @@ -7,12 +7,6 @@ use moros::entry_point; entry_point!(main); fn main(args: &[&str]) { - let n = args.len(); - for i in 1..n { - syscall::write(1, args[i].as_bytes()); - if i < n - 1 { - syscall::write(1, b" "); - } - } + syscall::write(1, args[1..].join(" ").as_bytes()); syscall::write(1, b"\n"); }