-2

When using 'gcc' -Os option not accepted

sleep command produces sleep: cannot read realtime clock

Can no longer perform:

sudo cat XXX >> YYY

Results in Permission denied where XXX and YYY are owned by root

  • I'll expect `sudo cp XXX >> YYY` to fail since cp needs a destination operand instead. – Kulfy May 01 '20 at 08:13
  • When using 'gcc' -Os option not accepted. Sleep is a separate issue sleep command produces sleep: cannot read realtime clock. Sorry I meant to say sudo cat XXX >> YYY – Ken-unix.guy May 01 '20 at 18:01
  • sudo cp XXX >>YYY should have read sudo cat XXX >> YYY – Ken-unix.guy May 02 '20 at 14:40
  • In `sudo cat XXX >> YYY`, `sudo` was attached to the `cat` not the text redirection. That's why permissions were denied. See [How to solve “permission denied” when using sudo with redirection in Bash?](https://askubuntu.com/questions/230476/how-to-solve-permission-denied-when-using-sudo-with-redirection-in-bash) – Kulfy May 02 '20 at 15:39
  • Thanks. I ended using cat AAA | sudo tee -a BBB >/dev/null That works across platforms like Ubuntu, Debian, Linux Mint at the suggestion of a friend. – Ken-unix.guy May 03 '20 at 16:58
  • What are you trying to achieve? What errors do you encounter while running `gcc -Os`? As of now it seems you're asking 2 questions in a single question which might make this question too broad. Consider asking one question in a post. – Kulfy May 07 '20 at 15:45
  • At this point I am using gcc -s instead of gcc -Os -Os was supposed to be for size optimized. And yes , there were two different questions. – Ken-unix.guy May 08 '20 at 21:40

1 Answers1

-1

Under Ubuntu 20.04 gcc -Os for optimize for size does not work am using gcc -s

and cat issue has been fixed with cat AAA | sudo tee -a BBB >/dev/null

And the shell 'sleep' command not working on WSL turned out to be a 'libc' issue.