nmake syntax error at -e line 1, near "'755' ]" - nmake

Everytime I try to run nmake on any package, it gives me this error:
syntax error at -e line 1, near "'755' ]" Missing right curly or
square bracket at -e line 1, at end of line Execution of -e aborted
due to compilation errors.
Does anyone know why this might be?
I believe this answer might be what's happening: Compiling WWW::Curl on ActivePerl
In my /N output, there's:
C:\Perl\bin\perl.exe -MExtUtils::Install -e "pm_to_blib({{#ARGV},
'blib \lib\auto', q[], '755')"
What's with the {{? I guess this Makefile is just messed up then. The same thing happened when I tried to make Perltidy from source however.

I used dmake, and there were no problems with the curly braces.

Related

Why can't I use $(...) in PS1 instead of backticks?

My current PS1:
PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u#\h \[\033[35m\]`date +%Y-%m-%d,%H:%M:%S` \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$: '
Yes, it's a mess, but it serves me well - my prompts look like this:
P2759474#RVPTINTCL415MQC 2017-10-06,11:20:18 ~/repos/jdk (master)
They are even color coded, with user#machine in green, timestamp in purple, current location in yellow, and any git branch in blue. I'm just a little annoyed that I have to use backticks instead of a $() construct.
Anyone know why? Willing to help me understand it? It's only a problem when parsing complex prompt values with subshell commands, and only a problem then because I want to understand why it matters there... General improvement suggestions always welcome while we're at it.
Update -
Currently when I try to use $() I get a lot of
bash: command substitution: line 1: syntax error near unexpected token ')'
bash: command substitution: line 1: 'date +%Y-%m-%d,%H:%M:%S)'
bash: command substitution: line 1: syntax error near unexpected token ')'
bash: command substitution: line 1: '__git_ps1)'
My env has
BASH_VERSINFO=([0]="4" [1]="3" [2]="42" [3]="5" [4]="release" [5]="x86_64-pc-msys")
BASH_VERSION='4.3.42(5)-release'
[ -z "$BASH_VERSION" ] || shopt -q promptvars || ps1_expanded=no;
That tells me something, maybe... Thanks!
When you start trying to embed commands in your prompt, it is time to start using PROMPT_COMMAND.
# You won't even have to put the title-bar stuff in your prompt
# and there are already shortcuts for date and time
set_titlebar () {
printf '\033]0;%s:%s\007' "$TITLEPREFIX" "${PWD//[^[:ascii:]]/?}"
}
set_prompt () {
PS1='\[\033[32m\]\u#\h ' # user#host in green
PS1+='\[\033[35m\]\D{%Y-%m-%d},\t ' # Don't need date
PS1+='\[\033[33m\]\w\[\033[36m\]' # Directory in orange
PS1+=$(__git_ps1) # git info, if appropriate
PS1+='\[\033[0m\]\n$: '
}
PROMPT_COMMAND='set_titlebar;set_prompt'

Bash: Syntax Error Near Unexpected Token `(' When Using Wgrib2

Good Evening All,
I'm currently having a bash syntax issue when I try to run the following command in my terminal, the
bash: syntax error near unexpected token `('
error message pops up after I run the below code:
/mnt/grads/bin/wgrib2 /home/aaron/grads/data/sref_prob/20140530/15Z/sref.20140530.t15z.prob.grib2
-match ^(255|371|487|623|759|895|1031|1187|1343|1499|1655|1811|1967|2123|2279|2435|2591|2747|2903|3059|3215|3371|3527|3683|3839|3995|4151|4307):
-grib /home/aaron/grads/data/sref_prob/20140530/15Z/test.grib2
I realize that not many people on here probably have experience using wgrib2 but, this seems like a syntax error, not an issue with the program...
Parentheses and pipes have special meaning to the shell, you need to quote or escape them:
/mnt/grads/bin/wgrib2 /home/aaron/grads/data/sref_prob/20140530/15Z/sref.20140530.t15z.prob.grib2 \
-match '^(255|371|487|623|759|895|1031|1187|1343|1499|1655|1811|1967|2123|2279|2435|2591|2747|2903|3059|3215|3371|3527|3683|3839|3995|4151|4307):' \
-grib /home/aaron/grads/data/sref_prob/20140530/15Z/test.grib2

Linux bat file command line arguments:unexpected EOF while looking for matching `"'

i am running a bat file in linux as following .
java -cp ../lib/qautils.jar:../lib/Log4jWrapper1.2.jar:../lib/log4j-1.2.15.jar:../lib/jaa.jar com.pcube.qa.jaa.server.JAAServer -appdir /home/alpha/jaa/bin"
but if i run above getting following error:
./runjaa.bat: line 1: unexpected EOF while looking for matching `"'
./runjaa.bat: line 2: syntax error: unexpected end of file
Will anyone suggest me , where i am doing mistake.
If i delete " at the end , saying the directiory ,/home/alpha/jaa/bin does not exists.
Assuming that what you posted is accurate, you have a trailing " on that line that doesn't match up with another quotation mark. A quotation mark opens a quoted string, so your shell is looking for the closing quote.
You don't need the quote in this example, so just remove it.

How do I fix unexpected end of file in bash script?

I had much luck last time I submitted a question so here goes: I am trying to debug a somewhat large BASH script when I get the following error:
./test.sh: line 418: unexpected EOF while looking for matching `"'
./test.sh: line 427: syntax error: unexpected end of file
The code below starts at line 400:
echo "###########################################################"
echo
;;
4)
culebra_carriers
get_month
get_day
logs_cdrs
logs_wap
get_mdn
echo
echo "###########################################################"
echo
echo "Searching for activity of $mobileNumber on $MON $DAY......."
echo
zgrep $mobileNumber $HOME/culebrapeak/$LOGCDR/$CULEB/$MON/$WAPLOG
echo
echo "###########################################################"
echo
;;
esac
done
}
clear
main_menu
How do I make this error go away? It looks like I have the double quotes in all the right places... but this is only my 4th or 5th bash script... so please go easy on me.
I was, indeed, missing a double quote at the top of my script. Thanks to all for the help!
A good way to solve problems like this is to use a text editor that highlights code between quotes. Short of that, if the "find" feature of your text editor gives a count too, you may be able to use it to quantitatively detect start/end character symmetry problems. The highlighting from the find feature will aide your eye tremedously.

in bash script unexpected "syntax error: unexpected end of file" on if statement [duplicate]

This question already has answers here:
Bash syntax error: unexpected end of file
(21 answers)
Closed 6 years ago.
W/hen i run the following code snippet
#!/bin/bash
if [ "foo" = "foo" ];
then
echo "true"
else
echo "false"
fi
echo "end"
i get
sfm_write_buffer_test.sh: line 9: syntax error: unexpected end of file
this doesn't make any sense. echo statements works fine, but when the if statement is encountered it gives the above mentioned error.
You're on Cygwin, right?
As I said in a comment, when I copy-and-paste your script and run it on my system, it works; the output is
true
end
But when I change the line endings from the Unix style '\n' to the Windows style '\r\n', I get the same error you got.
With the Windows-style line endings, bash doesn't see the then keyword; it sees a command named then\r. It never tries to execute it because it's scanning for the matching then or fi for the if keyword (which it recognized because it's not at the end of the line).
Make sure your shell scripts use Unix-style line endings.
The problem is the CRLF at the end of the script. Shell scripts throw this error when they see Windows-style line endings. You need to replace line endings in your shell script with Unix-style LF. Each IDE has it's own way of doing this.
Sublime Text 2 ==> View -> Line Endings -> Unix
Notepad++ ==> Edit -> EOL Conversion -> UNIX/OSX Format
Once you make that change and save the file, the shell script should execute without error.
This wasn't your specific problem, but this can also happen if you have pasted an indented heredoc inside your if statement and it has been converted from tabs to spaces. The end delimiter of the heredoc is never found because of the whitespace, and unexpected end of file is the result.

Resources