![]() |
![]() OCAU News - Wiki - QuickLinks - Pix - Sponsors |
|
|||||||
| Notices |
|
Sign up for a free OCAU account and this ad will go away! Search our forums with Google: |
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Member
Join Date: Feb 2010
Posts: 1,177
|
Hi,
I am playing around with BASH in Debian. I Vim'ed a file called script1 inside script1 was Code:
# My First script STR='HELLO World!' echo $STR Code:
bash script .script1 Code:
/usr/bin/script: /usr/bin/script: can not execute binary file
__________________
WTB 2TB & 3TB Sata HDDs |
|
|
|
| Join OCAU to remove this ad! |
|
|
#2 |
|
Member
Join Date: May 2009
Location: chermside.bris.qld.au:80
Posts: 2,601
|
Sounds like something isn't configured properly.
In shell try PHP Code:
PHP Code:
EDIT: Haha whoops, call it like Code:
./script1 Last edited by zach; 21st August 2012 at 2:14 PM. |
|
|
|
|
|
#3 |
|
Member
Join Date: Feb 2010
Posts: 1,177
|
Yeah, just seen that also I forgot to ad execute for the file as well so had to run chmod. Well that was my first attempt at a bash script and I failed V.V. Ow well can only improve from here.
__________________
WTB 2TB & 3TB Sata HDDs Last edited by ausghostdog; 21st August 2012 at 2:28 PM. |
|
|
|
|
|
#4 |
|
Member
Join Date: May 2009
Location: chermside.bris.qld.au:80
Posts: 2,601
|
Don't let permissions get you down man, type it straight into your shell, I find an interactive REPL makes learning a new language much easier.
|
|
|
|
|
|
#5 |
|
Member
Join Date: Feb 2010
Posts: 1,177
|
Yeah, making the transition from Windows to Linux has been fun. Slowly learning all the commands. If it wasn't for uni I would never touch this. Something new to learn is always fun. I'll just remember to ls -l before I do anything on scripts from now on
__________________
WTB 2TB & 3TB Sata HDDs Last edited by ausghostdog; 21st August 2012 at 2:46 PM. |
|
|
|
|
|
#6 |
|
Member
Join Date: Aug 2005
Location: Bangkok
Posts: 2,973
|
chmod +x <filename>
then ./<filename> |
|
|
|
![]() |
| Bookmarks |
|
Sign up for a free OCAU account and this ad will go away! |
| Thread Tools | |
|
|