when i use system2
call the ln
command,example,my test.R is:
file.create("a.txt")
dir.create("test")
system2("ln",args = c("-s","a.txt","./test"),stderr = T)
system2("ln",args = c("-s","a.txt","./test"),stderr = T)
run it
Rscript test.R
and the echo $?
is 0
How should I make it exit the script when "test/a.txt" exists