I'd like to make echo "Hello, Ubuntu!" code print on the bash.
Last night, I lost my temper for Windows Defender and switch my only 1 laptop into Ubuntu. Almost of all went well but the simple Nim code echoing got not to work.
When compiling, it prints.
wani@last-asset:~/$ nim c -r test.nim
Hint: used config file '/usr/lib/nim/config/nim.cfg' [Conf]
Hint: used config file '/usr/lib/nim/config/config.nims' [Conf]
....CC: test.nim
Hint: [Link]
Hint: 22421 lines; 0.432s; 25.461MiB peakmem; Debug build; proj: /home/test.nim; out: /home/test [SuccessX]
Hint: '/home/test' [Exec]
Hello, Ubuntu!
But after that, let test (executable) works, nothing gets shown.
wani@last-asset:~/$ test
wani@last-asset:~/$ test
wani@last-asset:~/$
Anybody guess?
Ubuntu: 20.04.2 LTS(Focal Fossa) Nim: 1.4.8 DefaultShell: Bash
wani@last-asset:~/$ echo $SHELL
/bin/bash
wani@last-asset:~/$ nim -v
Nim Compiler Version 1.4.8 [Linux: amd64]
Compiled at 2021-05-25
wani@last-asset:~/$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_ID="20.04"
...
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
In Linux "test" is different from "./test", in your case you just call Bash's "test" built-in command, while you need to do "./test" to run the actual binary.
Also, it's not directly related to your issue, but why are you compiling in /home? It's not good to use that directory for anything, it should only have home directories of the users, and then you can do whatever you want inside your user's directory, e.g. /home/wani/
To easily switch to your home directory in a shell you can just do cd ~ and your current directory will be changed to your home dir :)
or just cd
So fast! Thank you! It works perfectly. Feeling embrassed, I'd never been conscious about whether is an executable or a command thanks to ".exe".
I'll stop sticking around with using "test".
About a directory, I did it for some privacy reason, but thank you for your teaching.