I create this code into ruby for make one directory and change position in this directory. But it not work and i understand why bash return error
sh: :1 cd /path/ not found:
this is my code in ruby
#!/usr/bin/ruby
def pr_cartella
@cartella=ARGV[0] #prendo l'argomento
Dir.mkdir @cartella #creo la cartella dall'argomento ottenuto
if Dir.exist? @cartella
puts "bene la cartella è stata creata"
Dir.chdir @cartella
entra
end
end
def entra
comando = "cd " + Dir.pwd + @cartella
%x[ "#{comando}" ]
end
pr_cartella