I have a very simple question. I am running a Ruby script to access the contents of a directory on Linux. The directory is passed through the command line when ruby ββscript is executed.
My question is how to use command line argument in command for ruby?
I have it installed like this:
usrDirectory = ARGV[0]
lsCmd = `ls -l`
I need to use something like ls -l usrDirectory. Can I just insert it into the command as it is?
source
share