GIDForums  

Go Back   GIDForums > Computer Forums > Computer Software Forum - Linux
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 18-Dec-2005, 08:25
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 826
admin will become famous soon enough
Post

Re: A basic Bash Script


I just posted a GID Community blog entitled: A basic Bash Script.

Quote:
Today marks the second day since I wrote my first Bash script. Here are some of my notes put together so it may help someone like me in the future, someone who has never written a Bash script before in his/her life!

Basic Bash Script read more...

Please let me know what you think.

This is an auto-generated message posted by GIDNetwork™ on behalf of the author.
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
  #2  
Old 15-Jan-2006, 07:02
dsmith's Avatar
dsmith dsmith is offline
Senior Member
 
Join Date: Jan 2004
Location: Utah, USA
Posts: 1,351
dsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of light

Re: A basic Bash Script


I too have a great respect and fascination with bash scripts. They can be extremely simple (similar to a DOS batch file), but they can be extremely complex with functions, control loops, etc.

I usually place my bash scripts into /usr/local/bin which is part of the search path, but does not have any of the system executables placed there.

Good stuff J.
  #3  
Old 02-Mar-2006, 20:24
chemist chemist is offline
New Member
 
Join Date: Mar 2006
Location: Cincinnati, Ohio
Posts: 1
chemist is on a distinguished road

Re: A basic Bash Script


I too wrote 5 shell scripts and attempted to make them executable. They are in /usr/bin and i can go to / and call them by name, except for 1. they are:

backup - works fine calling from /
restore - works fine calling from /
clspool - works fine calling from /
idrestore - works fine caling from /

But idbackup will not call from / . I have to call it s follows:
/bin/ash /usr/bin/idbackup.

I cant figure why 4 will work and 1 will not
  #4  
Old 10-Apr-2006, 08:05
dsmith's Avatar
dsmith dsmith is offline
Senior Member
 
Join Date: Jan 2004
Location: Utah, USA
Posts: 1,351
dsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of light

Re: A basic Bash Script


Quote:
Originally Posted by chemist
I too wrote 5 shell scripts and attempted to make them executable. They are in /usr/bin and i can go to / and call them by name, except for 1. they are:

backup - works fine calling from /
restore - works fine calling from /
clspool - works fine calling from /
idrestore - works fine caling from /

But idbackup will not call from / . I have to call it s follows:
/bin/ash /usr/bin/idbackup.

I cant figure why 4 will work and 1 will not

Interesting....

Are they all constructed in a similar manner?

Have you set the proper ownership/group info?

Just curious can you call it by just typing /usr/bin/idbackup? If not, I have to suspect that something is telling the kernel that it is not an executable file.
  #5  
Old 14-Apr-2006, 12:28
ghostdog74 ghostdog74 is offline
New Member
 
Join Date: Apr 2006
Posts: 2
ghostdog74 is on a distinguished road

Re: A basic Bash Script


Quote:
Originally Posted by chemist
I too wrote 5 shell scripts and attempted to make them executable. They are in /usr/bin and i can go to / and call them by name, except for 1. they are:

backup - works fine calling from /
restore - works fine calling from /
clspool - works fine calling from /
idrestore - works fine caling from /

But idbackup will not call from / . I have to call it s follows:
/bin/ash /usr/bin/idbackup.

I cant figure why 4 will work and 1 will not

did you have #!/bin/bash in your first line of your idbackup script?
 
 

Recent GIDBlogReview: Gel laptop cooling pad by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: My first BASH Script. admin Computer Software Forum - Linux 0 17-Dec-2005 07:29
[ANN] New script engine: Open Basic (Basic syntax) MKTMK Computer Programming Advertisements & Offers 0 01-Sep-2005 06:13
NOT sure what is wrong with script fscanf jenmaz C Programming Language 14 29-Oct-2004 14:53
Two virtual hosts, cgi script behaves differently on each blimbo Apache Web Server Forum 0 04-Aug-2004 09:35
JavaScript Tutorial Part 1 pcxgamer Web Design Forum 2 01-Dec-2003 09:16

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 09:46.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.