I am trying to run a command from ruby script. I got stuck in changing the folder path. Below is the command that I wrote. Can anyone let me know how to go ahead?
system("cd /home/user/Source/pxe/")
I want the terminal to point to the folder pxe
when I run the ruby script. Is the code above correct? If not, can you let me know what the correct way is to call the cd
command from ruby script?
Do you want to change current directory for the script? Use Dir.chdir.
Dir.chdir('/home/user/Source/pxe')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With