Solved - Simple script wont run

Forum rules
Before you post please read how to get help

Solved - Simple script wont run

Postby fiddler2500 on Wed Sep 19, 2012 5:35 pm

I have a small file on my desktop called "test.run" and it has the follwoing code in it:
test.run has permission to run as an application.

#!/bin/bash
x=5
y=10
echo "$x and $y"

When I run it in the Console and enter each line by hand, it all works fine (ignoring the shebang line)

However, when I enter "sh test.run", I get:
sh: 0: Cant open test.run

I have also tried this shebang line (#!/usr/bin/env bash) but same result.

Running Mint 13, pretty standrd setup.

Any suggestions

K
Last edited by fiddler2500 on Wed Sep 19, 2012 5:47 pm, edited 1 time in total.
fiddler2500
Level 1
Level 1
 
Posts: 9
Joined: Tue Sep 18, 2012 10:43 pm

Linux Mint is funded by ads and donations.
 

Re: Simple script wont run

Postby fiddler2500 on Wed Sep 19, 2012 5:46 pm

What an egg.

I was in the wrong directory

Sorry aboit wasting time.

Cheers
K
fiddler2500
Level 1
Level 1
 
Posts: 9
Joined: Tue Sep 18, 2012 10:43 pm


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 5 guests