I am using system
command to find files on ubuntu
, and trying to redirect the result on screen to a txt file, as following example.
# make file
system("touch a.txt")
system("touch b.txt")
system("touch c.txt")
system("touch d.txt")
sink("t.txt")
c("a.txt", "b.txt")%>% lapply(function(f) {
system(sprintf("find -name %s", f))
})
sink()
but the result turns out to be a list with O's inside. Please advise how I can achieve that. Thanks.