I write this code in my rails project.It’s to execute a shell script ,But my shell script can catch @directdown only.
rails script
@cmd = "/downafile.sh #{@directdown} #{@file.id} #{@filename}"
`#{@cmd}`
shell script
echo $1 >> /tmp/ceshi.tmp
echo $2 >> /tmp/ceshi.tmp
echo $3 >> /tmp/ceshi.tmp
Thanks.
“ and system command works in similar manner.
But system method will return true on success.
Try with this:
@cmd = "/downafile.sh '#{@directdown}' '#{@file.id}' '#{@filename}'" `#{@cmd}`