Skip to content

Mistake in the Windows command line code in the Rust book #33219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TomasHubelbauer opened this issue Apr 26, 2016 · 5 comments
Closed

Mistake in the Windows command line code in the Rust book #33219

TomasHubelbauer opened this issue Apr 26, 2016 · 5 comments

Comments

@TomasHubelbauer
Copy link
Contributor

In the Getting Started section of the Rust book, there's this snippet under Creating a new Executable and Source Directory:

$ mkdir src
$ mv main.rs src/main.rs
$ rm main  # or 'del main.exe' on Windows

On Windows, there's no mv, just move. The mv and other commands are available when one uses Cygwin or similar, but the book says nothing about that, so it should be fixed to include a comment similarly to the line underneath it.

$ mkdir src
$ mv main.rs src/main.rs # or 'move main.rs src/main.rs' on Window
$ rm main  # or 'del main.exe' on Windows
@GuillaumeGomez
Copy link
Member

Want to open a PR to modify it yourself? :)

@TomasHubelbauer
Copy link
Contributor Author

I do and I will in a couple of days. :)

@GuillaumeGomez
Copy link
Member

Great! cc me once done then please. :)

@retep998
Copy link
Member

More specifically, it is only the cmd shell which doesn't support rm or mv. Powershell has aliases for both the cmd and bash versions.

@TomasHubelbauer
Copy link
Contributor Author

TomasHubelbauer commented Apr 27, 2016

@retep998 Thanks for the note. This is definitely good to know, but I haven't included it in the comment since with move you can't go wrong whichever shell you choose on Windows, so this should be beginner friendly.

People who already know they can use mv in PowerShell will just use it so I think it's right the comment doesn't mention it. Still a good point, tho!

Manishearth added a commit to Manishearth/rust that referenced this issue Apr 27, 2016
…ch-1, r=GuillaumeGomez

Fix use of the `move` command in the Windows shell

`move` works both in `cmd` and in Powershell. `mv` works only in Powershell and the book says nothing about which shell is recommended so this could confuse beginners.

Closes rust-lang#33219.
steveklabnik added a commit to steveklabnik/rust that referenced this issue Apr 28, 2016
…ch-1, r=GuillaumeGomez

Fix use of the `move` command in the Windows shell

`move` works both in `cmd` and in Powershell. `mv` works only in Powershell and the book says nothing about which shell is recommended so this could confuse beginners.

Closes rust-lang#33219.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants