You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rm returns an illegal option error.
rm on macOS doesn't support `--recursive` and `--force` instead opting for `-r` and `-f` respectively. I'm guessing it has something to do with this from the man page:
NOTE
The rm command uses getopt(3) to parse its arguments, which allows it to accept the ‘--’ option which
will cause it to stop processing flag options at that point. This will allow the removal of file names
that begin with a dash (‘-’). For example:
rm -- -filename
The same behavior can be obtained by using an absolute or relative path reference. For example:
rm /home/user/-filename
rm ./-filename
@dmccaffery this issue also impacts install-dotnet (and probably install-aws) when run with -f or --force since it uses the long form rm --recursive --force instead of rm -rf.
Also, I noticed that install-gcloud when run with -f or --force uses rm -rf instead of rm --recursive --force. I can open a PR with a fix for all three scripts so we're using rm -rf everywhere if that's how you want to proceed.
@patrickserrano I would like to follow the below statement on our readme...
NOTE: We believe in transparency and clarity of commands, hence the expanded form for the options above. The -s flag for the shell command means "read commands from standard input". For more information, see the POSIX Specification.
I understand that it seems macOS cannot support the fully qualified flags. in such a case it may be necessary to create a wrapper around the rm command or a separate script for macOS. This in the long term will require more maintenance.
Commands to Reproduce
Expected Results
Actual Results
Any additional logs that will help us?
install-gcloud: installing gcloud-sdk... download-safe: attempting to download: https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz rm: illegal option -- - usage: rm [-f | -i] [-dPRrvW] file ... unlink file
Operating System(s)
macOS
Operating System (Other)
No response
Architecture
arm64 / aarch64
Shell
zsh
Terminal Program(s)
other
Terminal Program(s) (Other)
iTerm2
What is the output from
uname -srv
on the system(s) where the bug is occurring?Darwin 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000
Code of Conduct
The text was updated successfully, but these errors were encountered: