Programming :: Bash Script Cannot Run Functions - No Syntax Errors

Apr 23, 2011

I have this project which I've been working on essentially nonstop for the past three days and due to work I am running low on time. I'm new to Linux/Unix and my Teacher has assigned us a scripting project, due for Monday. I have All the functions for the project in a separate file which run as a daemon process when I log in. It has no syntax errors but my Script can not run the functions (I'm not sure where they go before or after the body) and I have one function I'd like you guys to take a look at. It has a Second menu leading to a case statement but it does not run after the Search. I'm Kinda tired of looking at the CLI but I have to finish this.

phoneEdi() {
directory=~/phonepro/directory
loop="y"
clear
tput cup 4 4; echo "Record Editor" .....

View 1 Replies


ADVERTISEMENT

General :: (small) Bash Script - Catching Syntax Errors

Sep 9, 2010

I've been trying to find a bug in this test script, but haven't been able to so far. I'm not lazy, I promise...just new to Bash so am having a hard time catching syntax errors. I call the script with the option -disableVenusBld, and it still prints "Starting build", which it shouldn't be doing right?

[Code]...

View 1 Replies View Related

Programming :: 'makefile' \ Errors Are Mainly Due To Multiple Declarations Of The Functions?

Nov 24, 2010

This is the makefile....

Code:
animesh:main.o input.o bsort.o output.o
gcc -o animesh main.o input.o bsort.o output.o

[code]....

View 7 Replies View Related

Programming :: MySQL Syntax And Code Errors

Feb 10, 2010

I am reading Sams Teach Yourself SQL in one hour a day. In this book they work with both Oracle and MySQL to teach you SQL. So I installed mysql on my box and I am creating the empty database they use in this book so I can follow along as I read. I have noticed a few typos in the book and now I have noticed some code errors too. I just don't know enough to fix em. I am working on creating the empty database and I am getting syntax errors when I create certain tables. I have checked both the printed version of the book and the electronic version (which differ slightly) and both give me the same synatax errors. First is Creating the first table of the database. Here is the code given to me to enter. The Electronic version

[code]...

how I can correct this error and create these tables?

View 5 Replies View Related

Programming :: Bash Syntax To Translate From Csh Scripts?

Jan 1, 2011

I am setting some environmental variable in my .bashrc , the sample code I was provided with is for CSH but I am using bash, and there are some syntax differences between them ... I got most of the script to work, but I am getting an error at this part :

Code: if ($RMSTREE == $RMANTREE) then
set path=($path $RMANTREE/bin)
else

[code]...

View 2 Replies View Related

Programming :: Global Bash Shell Functions - A.sh: Line 2: Echotm: Command Not Found

Sep 13, 2010

I wonder if there is anyway to make a user-defined bash shell function global, meaning the function can be use in any bash shell scripts, interactively or not. This is what I attempted:

Code:

$ tail -n 3 /etc/bashrc
echotm () {
echo "[`date`] $@"
}

[code]....

View 11 Replies View Related

Programming :: Bash Syntax \ See 1 If The Exit Value Of Diff Is 0, And Otherwise Wanna See 0?

Dec 26, 2010

I'm new to scripting and I have a trouble with if statement syntax. The code is: Code: #there is a diff command here, and it does what i want but#i wanna see 1 if the exit value of diff is 0, and otherwise i wanna see 0.#the problem is here: (syntax error near unexpected token "then")

if["$?"==0];
then
echo 1

[code].....

View 1 Replies View Related

Programming :: Bash - Syntax For ((<arithmetic Expression>)) Usage ?

Mar 18, 2010

I do not understand bash' syntax regarding the use of ((<arithmetic expression>)). $((<arithmetic expression>)) is tokenised to a single word. OK.

Code:

In isolation

Code:

It may not be used where a word is expected. This generates a syntax error. Why?

Code:

View 6 Replies View Related

Programming :: Bash Daemon Encounters Syntax Error After Midnight?

Feb 24, 2011

I have a daemon script which wakes up every 5 minutes and checks the health of started processes. It works fine during the day but throws a syntax error just after midnight.Here is the log:

(02/22-23:49) Check all started processes
(02/22-23:54) Check all started processes
(02/22-23:59) Check all started processes

[code]....

View 9 Replies View Related

Programming :: Bash Script Giving Unexpected End Of File - Syntax Error

Apr 12, 2010

I have a bash script giving me the following error:

[Code]...

When I run it I am getting: ./svnup: line 61: syntax error: unexpected end of file Can't for the life of me figure out what is wrong. It's a script to export the latest revision from SVN to the web root folder and archive the previous version, basically.

View 4 Replies View Related

Programming :: Run Small Shell Script - Bash - Syntax Error Near Unexpected Token `('

Jul 9, 2010

I was trying to run small shell script, but could not run. I got the error like in subject.

This is exact way i was trying to do.

View 6 Replies View Related

General :: SUSE 10 Syslog-ng Syntax - Bash: Syntax Error Near Unexpected Token "("

Apr 20, 2011

I am a Novell (now defunct) CNE tring to learn Linux and am having a lot of trouble finding out where the WB 6-6 is wrong in the syntax for adding local4... the the syslog-ng config file. In the instructions there are discrepancies between commas and simi-comma, they are both in the statements in no particular order. there is no pattern to them. Here is what the book shows:

filter f_local4debug { level(debug) and facility(local4); };

When I try to input this in the Gnome terminal window to try and find out where it goes wrong I get the following: -bash: syntax error near unexpected token "(" If I can get the correct syntax I belive I can use the info to get past the rest of this portion of the lesson. I am desperate to learn Linux as the only jobs out there for a Novell CNE are migrations to MS, which really sucks, since MS really really sucks.

View 1 Replies View Related

Programming :: Bash Script Can't Handle Errors When Run By Cron

Jan 8, 2009

I have a script that that is supposed to send me an e-mail when a host is not responding to ping:

The script works fine when I execute it directly but when cron executes it, the ping error is never picked up by the script so the if statement is ignored.

View 4 Replies View Related

Programming :: Define Functions Within Other Functions In C++?

Mar 11, 2010

Is it possible to define functions within other functions in C++? I know it is the case in other languages.

View 2 Replies View Related

General :: Unable To Use Functions With Bash

Dec 24, 2009

Code:

#!/bin/bash
#Functions
CallFunct() {
functio()

[code]....

When I try to run the current code, it stops on the bracket after functio() in CallFunct(). The only way I could get this to run was by removing CallFunct and just calling functio.

View 3 Replies View Related

General :: Passing Commands As Arguments To Functions In Bash Script?

May 31, 2010

I wrote a simple bash script to let me treat any set of programs like a deamon. For example if I configure the script a certain way I can start/stop/get the status of apache, mysql and php all from one command. I am having a bit of a problem though. I am passing commands as strings to a function and then depending on the arguments to the script it might run one of these commands or another. Some of these commands need to beun in the background though, such as deluge-web. When I send "deluge-web &" to the function and it execute it deluge-web does not start in the background. I can't figure out why this is. I have tried escaping the & with ''s and with a , but nothing seems to work. I know that this is some idiotic thing that I am overlooking, but I am a bit stumped. Here is the script configured to start/stop/get status of deluged and deluge-web.

Code:
#!/bin/bash
function checkanddosomething {

[code]...

View 3 Replies View Related

General :: Libtool Has Syntax Errors When Running After GLib-2 Cross Compile For PPC Using LTIB?

Jun 10, 2010

First, I'm trying to cross compile mono 2.6.4 so that it will run on Freescale Embedded Linux for a PowerPC CPU. My host machine is running Fedora 13 on an x86. Freescale provides a copy of the Linux Target Image Builder (LTIB) that has been pre-configured for the particular board I'm using, and LTIB seems to be able to help with the cross compilation of other stuff--you can add in your own packages to be built and included in your newly-built Linux image.

Mono depends on pkg-config and glib-2, so I have selected them in the LTIB package selection config. I've also added a new package for mono that builds mono-2.6.4 from the source tar (after the other deps have also been built).

I'm having a problem getting the glib-2.24.0 package libraries created. Basically they appear to build and link ok, but then libtool runs and errors out claiming it has a syntax error! (numerous wths followed...)

Here is LTIB's temporary build script for only the glib2 package:

Code:

Here is the output when building the glib2 package (configure + make):

Code:

Build path taken because: directory build, build key set, no prebuilt rpm,

View 7 Replies View Related

Ubuntu :: Bash If/then Conditional Syntax?

Feb 7, 2011

I pride myself on at least trying to help myself before I ask, but I've been staring at this a long time, I'm just not getting any traction.I've literally got 3 linux references on my desk right now that say that I should be able to use if conditionals, for example

[ -d FILE ]True if FILE exists and is a directory.
[ -e FILE ]True if FILE exists.
[ -f FILE ]True if FILE exists and is a regular file.

[code]....

View 7 Replies View Related

Fedora :: Create A Shell Script File With Two Functions - Bash Scripting & /etc/bashrc

Oct 6, 2010

how come I can create a shell script file with two functions, I can execute the file, but when running declare -f, the functions are not on memory, and when invoking the function bash returns invalid. In the other hand, I can copy & paste the two functions at the end of my /etc/bashrc file.... then I can called the function by name.... and the commands within that function run on my session. here is a print of all my bash packets:

[Code]....

Does Fedora has restrictions on shell scripting? I haven't touch bash in seven years, so if things have change on it I'm behind on it, and sorry for my ignorance.

View 1 Replies View Related

Programming :: C++ Programming With Simple RTAI Functions Outputing Words?

Apr 11, 2011

I need help as I am not proficient with Linux C++ Programming. There are two parts which I need to do in the coding provided below.

1. Produce the program so it can output the word "Hey there!" and wait two minute and print the word "See you later!".

2. Produce the program that will output the text "Cool" every 20 seconds by setting a periodic task.

Quote:
#include <linux/kernel.h>
#include <linux/module.h>
MODULE_LICENSE("GPL");
int init_module(void)
{
printk("Hey there!

[Code]...

View 3 Replies View Related

Ubuntu :: Bash Script Syntax Different For (Lucid)?

Feb 17, 2011

In a bash script brought over from a Debian/Lenny system, Ubuntu 10.04 stumbles on the left parenthesis in the expression below:NEED_COLS=$[($HEX_WIDTH * 4) + 12]Is it an Ubuntu/Debian script style mismatch, or just post-Lenny? If that can be answered, is there a way to reconcile or syntax check older scripts?

View 2 Replies View Related

General :: Bash Script Syntax Fail As Root?

Apr 12, 2011

I'm scratching my head over a very simple netcat-based heartbeat monitoring script i wrote.

here we go:
Code:
echo `date --utc "+%Y-%m-%d %H:%M:%SZ"` script started

[code]...

View 6 Replies View Related

General :: Bash - Syntax Error Near Unexpected Token `('

May 2, 2010

I am trying to install vlc media player on my backtrack3 but when i am giving a command xvjf to extract bz2 file then

bash: syntax error near unexpected token `('

View 1 Replies View Related

Software :: Bash Script Syntax (Get Existing Directory)

Sep 10, 2009

I'm starting to learn bash scripting and I can't figure out what's wrong with the following.

Code:
#!/bin/bash -x
ALFA=`kdesu "kdialog --getexistingdirectory ."`
echo $ALFA

View 9 Replies View Related

General :: Custom Syntax Highlighting In Bash Shell - Using Keywords

Apr 25, 2011

I know it's possible to change the $ user@hostname colors, but is it possible to color different things? Could I make all numbers/integers a certain color. Or set certain keywords to be bold?

View 1 Replies View Related

General :: Bash Shell Syntax For Opening A Text Editor?

Apr 28, 2011

I'm trying to be able to Open a text editor without needing an existing file.This is my code:

case $ans in
"Show Today") echo "$(date)";;
"Show Calendar") cal;;

[code]...

View 14 Replies View Related

Software :: Bash Syntax - While Loop With Multiple Comparison Operators

Apr 21, 2009

I'm trying to code the following WHILE loop in Bash:
While [string1 is non zero] and [string2 is non zero] and [counter < max]
Do
...
Done

I can't get the syntax right. I've tried:
Code:
while [ -n "$STRING1"] -a [ -n "$STRING2"] -a [$COUNTER -lt $MAX ]
But I get 'Too may arguments'

View 4 Replies View Related

Programming :: Valgrind Output Showing Addresses Not Code Against Errors - 2 Errors From 2 Contexts (suppressed: 0 From 0)

Feb 26, 2010

I am running Valgrind on my program. It shows me two errors but mentions only addresses against them and not actual code even on a debug build.

The output is

==23002== Memcheck, a memory error detector.
==23002== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==23002== Using LibVEX rev 1575, a library for dynamic binary translation.

[code]....

View 1 Replies View Related

Ubuntu :: Bash: Syntax Error Near Unexpected Token `(' \ When Want To Share A Folder?

May 16, 2010

I install nfs-common,nfs-kernel-serverNow I can not use

PHP Code:
# home 192.168.1.10(ro,no_root_squash) 
I get
Quote:
bash: syntax error near unexpected token `('

when I want to share a folder

View 2 Replies View Related

General :: Deleted The /etc/rc.d/functions Folder And Functions.d Script And Turned Arch Machine Into A Brick?

Mar 19, 2011

None of my daemon scripts work now, and the startup process displayed errors. Should I reinstall the OS and start from scratch, or is there a way to recover these files? Is there a way to rebuild the files I deleted?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved