LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-24-2008, 11:08 PM   #1
wrapster
Member
 
Registered: May 2008
Posts: 155

Rep: Reputation: 30
running unix cmds from ruby, having some issues!


hi all,
I am trying to change dirs using shell commands in ruby
this is what i came up with but its not working
Code:
.
print " Please enter the absolute path to store downloaded files :"
dwd_path = gets.chomp
system("cd #{dwd_path}")
what could be the error?
from irb i was able to determine that providing "/" while specifying the path could be causing the problem ,how do i change accordingly?
 
Old 09-25-2008, 01:31 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,788

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Whatever the language, changing the current directory cannot be done but by a builtin/internal command.

In ruby case, that would be Dir.chdir().
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ruby SDL/ Ruby OpenGL tutorials/reference? LinuxNoob75 Programming 0 12-30-2007 12:47 PM
PHP v Ruby/Ruby on Rails Neko_D Linux - General 4 02-08-2007 11:56 PM
[Ruby] Tar'ing or Zip'ing with ruby script lmcilwain Programming 2 01-19-2007 06:56 PM
Issues with UNIX Local Sockets permission ghoughto Programming 2 12-13-2004 06:38 PM
does any know % of servers running unix and desktops servnov Linux - General 6 11-04-2004 07:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration