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


ADVERTISEMENT

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

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 View Related

General :: Bash Catching The Function Returning Value Into A Variable?

Mar 17, 2010

i am dealing with this problemI have a function

function Une {
...
return $some_variable

[code]...

View 6 Replies View Related

General :: Unidentified Error In Bash Script That Notepad ++ Is Not Catching?

Jun 24, 2011

I've been debugging the following script all evening and am now stuck...this script is supposed to ssh to a router, pull interface conf, 'cut' 3 pieces of info, and then print the results of 2 as well as the 3rd (after running a ping cmd on the linux box):

SCRIPT_CODE
#! /bin/bash
lb1="0"

[code]....

View 4 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

Software :: Catching Signed And Unsigned Integers In BASH?

Dec 30, 2010

Solving issues with signed and unsigned numbers in BASH.For a start, Yes, BASH is type independent � I know that. My problem lays in catching executables output into a BASH variable.My executables are not quite UNIX compatible, where returned values are 0 for OK, >0 ERROR. They return 0 for OK, >0 WARNING (only, so move on) and <0 ERROR (abort) instead.

Code:
// C++ BIN A
int main(){

[code]...

View 4 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

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

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

General :: Process Billions Of Small Files Using Bash Shell Commands With Limited Memory?

May 26, 2010

I need to process billions of small files using bash shell commands with limited memory size (256MB). If any of those files contain certain "keywords", the file will be removed. I tried with command:

find . -type f -exec grep -i -l -H "keyword" '{}' + | xargs rm -rf

where all files are located within the current directory. But the command above failed in "out of memory".

View 1 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

General :: Want To Format Bash Errors

Jun 8, 2011

I am using Fedora 14 and when I am executing a file:

#!/bin/bash
asd #assuming this command does not exist

I am getting following error:
/path/to/file: line 2: asd: command not found

I want to format it so it outputs error in same way as it would when it was executed from terminal:

$ asd
bash: asd: command not found

View 1 Replies View Related

General :: Can't Open File/abcd/configFiles/vim/syntax/syntax.vim?

Mar 7, 2011

When ever i open vim, i get the error that the following error: E484: Can't open file/abcd/configFiles/vim/syntax/syntax.vim There was a .vimrc file in my home folder that i have removed.

Still i keep getting the same error. Presently in my home folder there is no .gvimrc or .vimrc file.

But still i keep getting the same error. I am not too sure where this file is mentioned.

Background info: The SHELL has been changed from tcsh to bash Earlier i had created a .vimrc file in tcsh, i have removed the .vimrc in bash SHELL.

View 1 Replies View Related

General :: Bash Error - Syntax Error Near Unexpected Token `{

Mar 4, 2010

I am new to shell scripting, bash specifically.

I am trying to run the following script:

Code:

When trying to execute I always get this error:

Code:

In case you need to know the permissions. Here is it:

Code:

I run the script using the following command:

Code:

View 1 Replies View Related

General :: Catching Stderr From Dd Over Ssh?

Oct 1, 2010

this might be an interesting one for the bash scripting gurus. I seem to break my teeth on it. The mission:- do a dd over ssh to trasnfer an image to another host- capture the dd PID on the other side- send a USR1 kill signal to it- capture that output on the original host It goes wrong on the last part. This is what I have before that step:dd if=image.gz | gzip -d | ssh host2 "dd of=/dev/vg1/lv1" &PID=`ssh host2 ps aux |grep dd|grep lx05|awk '{ print $2 }'`when I do "ssh host2 kill -USR1 $PIDI get nice outputs to the screen. When I replace the first line with:dd if=image.gz | gzip -d | ssh host2 "dd of=/dev/vg1/l01 2>/tmp/output.txt" &the dd command seemd to die. I suspect a problem with the pipe, since this does work when executing locally on a host without piping.

View 4 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

General :: Catching The Hibernate Event?

Jun 7, 2010

Is it possible to catch the power management events(hibarnate/standby/sleep)o the code(c++)?

View 2 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

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

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

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

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

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 :: 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

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

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

Ubuntu :: Run A Bash Script - Failing Miserably: Syntax Error Near Unexpected Token

Dec 18, 2010

I thought I'd make myself a bash script of sorts to download movie trailers, from a file where I manually dump the URL of each file on a separate line: file 'trailerlist':

[Code]...

View 7 Replies View Related







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