Ah, my apologies, I was wrong to assume you were using Rstudio.
You are using RGui to compose your script.
You are then using Rterm to run it.
I see that in Rterm you are calling Rscript, but Rscript is not an R function, nor a command of Rterm, its a utility in its own right.
Assuming that you are in an Rterm window, and that the working directory is set to be the same as where your hello.R script is then you need the source() function like :
source("hello.R")
here is an example, and showing some other useful functions.
I use getwd() to see where I am in Rterm
I use dir() to see what files and folders are at my current working directory
I can verify if a file i want is there with file.exists()
and finally I can use source to run it
source with echo=TRUE parameter shows the underlying code of the script as well as running it.
> getwd()
[1] "C:/Users/nirgr/Documents/R/scripts"
> dir()
[1] "experimentscreenshotscriptjs.html" "hello.R"
[3] "lubridate test.R" "report.html"
[5] "report.Rmd" "rmarkdownexample.R"
[7] "shiny test example.R" "tb_local.html"
[9] "tb_local.Rmd" "twitter_premium.jsonl"
[11] "webshotshinytest.R"
> file.exists("hello.R")
[1] TRUE
> source("hello.R")
[1] "hello world"
> source("hello.R", echo=TRUE)
> h<-"hello world"
> print(h)
[1] "hello world"