LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Having trouble with script in Ubuntu (https://www.linuxquestions.org/questions/linux-newbie-8/having-trouble-with-script-in-ubuntu-848680/)

josecolella 12-06-2010 11:27 AM

Having trouble with script in Ubuntu
 
I am trying to create a script that creates a vector and displays it. I used the command inivec but it didn't work.

#! /bin/bash
# Title: Vector
# Author: Jose Miguel Colella
# Description: Creating Vector
inivec MV 3 aa
done

How do I make it so the terminal executes mi script to create a vector. I know MV is the name and the output should be aa aa aa, but nothing.?

acid_kewpie 12-06-2010 11:43 AM

You can't be getting ' nothing' from stunning it, a if nothing else, the 'done' line would be causing ash error as it's being used illegally. What are you doing to run this? What happens?

grail 12-06-2010 05:53 PM

What happens when you run the exact same input on the command line?
ie, try running:
Code:

inivec MV 3 aa; done
Then from the errors you receive there you can work until you get the right input.
Remember that a script simply automates something you would have done by hand on the command line, so if it doesn't work there then it will never work in the script.

josecolella 12-07-2010 01:36 AM

I will try that thanks


All times are GMT -5. The time now is 06:16 PM.