Logo 
Search:

Unix / Linux / Ubuntu Answers

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds
  on Dec 04 In Unix / Linux / Ubuntu Category.

  
Question Answered By: Adah Miller   on Dec 04

I think I see the error - it appears to be in the function declaration.

You have parens there, and I think that's causing the error.

"Declaring a function is just a matter of writing function my_func {
my_code }.
"
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-8.html

Missing from your script was the the interpreter path (not
sure if it was left off when you copy/pasted or if it it's
missing from your actual bash script.

On some systems this line looks like

#!/usr/local/bin/bash
or
#!/usr/bin/bash

but for portability, I usually use
#!/bin/sh
and because of systematic symlinks, it "finds" the bash
interpreter path wherever it may happen to be.

Share: 

 
 
Didn't find what you were looking for? Find more on Script not working Or get search suggestion and latest updates.


Tagged: