Flex analyzer — bash syntax error near unexpected token '('
location: linuxexchange.com - date: August 3, 2014
I am super new to FLEX, I'm trying to write a simple FLEX lex file, but for some reason I get the error in the header.
The complete error is:
bash syntax error near unexpected token '('
The command I am running is:
flex sample.lex
OR
flex sample.l
Where am I going wrong here?
%{
union{
int val;
char name [30];
char str [80];
}yylval;
#include <stdio.h>
%}
%%
. ECHO;
%%
int main(int argc, char **argv)
{
if (argc != 2) {
printf("no input file>\n");
exit (1);
}
printf("token lexeme attribute\n");
printf("--------------------------\n");
yyin=fopen(argv[1], "r");
if(yyin!=0)
{ printf("file opened");
fclose(yyin);}
exit (0);
}
int yywrap () { return 1; }
bash: syntax error near unexpected token `newline'
location: ubuntuforums.com - date: September 1, 2009
Hello all. I'm running Ubuntu Server and am having problems running a .sh script trying to build a Open GTS Server.
the command is
bin/initdb.sh -rootUser=<rootUser> -rootPass=<rootPass>
The script is supposed to create a new mysql database. When i run the command i get..
-bash: syntax error near unexpected token `newline'
I've tried running it as sudo and my user and i get the same thing.
tia
Bash: Syntax error near unexpected token `then'
location: linuxexchange.com - date: February 10, 2014
the error is at line 21...
if [ $weight1 -gt $weight2 ];
then echo "Weight 2 should be greater than Weight 1."
else
if [ $weight1 -ge 20 ] && [ $weight1 -le 39 ];
then echo "Weight 1 is bike."
else
echo "Weight 1 is either bicycle, car, van or lorry."
fi
fi
bash: syntax error near unexpected token
location:
linuxquestions.com - date:
June 3, 2013
Trying to update firefox and this is what I type and get. What does this mean and how can I fix it please.
[
[email protected] firefox] # cp /root/Desktop/firefox-3.6.8(2).tar.bz
bash: syntax error near unexpected token '('
Trouble with bash script to move files: syntax error near unexpected token
location:
ubuntuforums.com - date:
June 18, 2009
I have a bunch of .html files in a folder that I want to move into a subfolder. So I wrote a simple script but it isn't working.
I test it out first:
Code:
[email protected]:~$ for FILE in *.html;do echo "${FILE}" "Notes_Enzymes/${FILE}";done
Notes_Enzymes.html Notes_Enzymes/Notes_Enzymes.html
Notes_Enzymes_ind.html Notes_Enzymes/Notes_Enzymes_ind.html
Notes_Enzymess.html Notes_Enzymes/Notes_Enzymess.html
[email protected]:~$
That looks good, let's go ahead and move everything:
Code:
[email protected]:~$ for FILE in *.html;do mv "${FILE}" "Notes_Enzymes/${FILE}";done
mv: cannot move `Notes_Enzymes.html' to `Notes_Enzymes/Notes_Enzymes.html': Permission denied
mv: cannot move `Notes_Enzymes_ind.html' to `Notes_Enzymes/Notes_Enzymes_ind.html': Permission denied
mv: cannot move `Notes_Enzymess.html' to `Notes_Enzymes/Notes_Enzymess.html': Permission denied
Oh, I must need to be root.
Code:
[email protected]:~$ sudo for
syntax error near unexpected token in bash using perl
location: linuxquestions.com - date: June 21, 2007
Hi,
I am getting this problem while running the command from shell. If I run the command directly on command prompt, its running fine.
Here, i used the back slash also to skip the special purpose of single quote, but getting the below problem.
Command is:
sh -c '(perl -pi -e \'print "TextContents" if $.==13\' "/usr/local/etc/stunnel/stunnel.conf")'
bash: syntax error near unexpected token `"/usr/local/etc/stunnel/stunnel1.conf")''
If someone can help me, it would be great!
This command is for entering a line TextContents to a file stunnel.conf file at line number 13.
Regards Ambrish
Bash script problem: syntax error near unexpected token `do
location: linuxquestions.com - date: August 15, 2011
Hello,
I am having a problem running a bash script, and I get the following problem:
Code:
syntax error near unexpected token `fi'
location: linux.com - date: October 8, 2010
#!/bin/bash
if [[ -e ${/fms2005/Sample/CronFlag.txt} ]] ; then
echo data file does exist
else
echo data file does not exist
fi
Error Msg:
Test.bsh: line 6: syntax error near unexpected token `fi'
Test.bsh: line 6: `fi'
what wrong with my script?
Im connecting to our Solaris Server through xShell...
thanks in advance...
Syntax error near unexpected token 'elif'
location: ubuntuforums.com - date: November 5, 2011
Hi, my friend and I are working on a private server running on 10.04 and when we run the linux_installer.sh we get the error:
PHP Code:
linux_installer.sh: line 77: syntax error near unexpected token 'elif'linux_installer.sh: line 77: ' elif [ "${option}" = "b" ]; then'
Here is the original code for the file:
PHP Code:
elif [ "${option}" = "b" ]; then echo rm -rf "${bkpath}/logon_backup.sql" rm -rf "${bkpath}/character_backup.sql" echo " [Deleting Old Backups] Finished…" echo
Syntax error near unexpected token fi
location: linuxquestions.com - date: February 27, 2009
Hello everyone, I am having trouble executing a script
When I try to, I get this: Line 31: Syntax error near unexpected token fi and Line 31: fi
if test $# = 0
then
echo
echo This script requires 1 argument
exit
fi
declare -i fileCount
declare -i dirCount
declare -i exeCount
fileCount=0
dirCount=0
exeCount=0
for i in $*
do
if test -f $1
then
fileCount=fileCount+1
fi
if test -d $1
then
dirCount=dirCount+1
fi
if test -x $1
then
exeCount=exeCount+1
fi
done
fi
echo Number of Files found=$fileCount
echo Number of Directories found=$dirCount
echo Number of Executable Files found=$exeCount
please wait...
Page: 1 2 3 4 5 6 7 8 9 10