Home > Syntax Error > Syntax Error Near Unexpected Token ' In Shell Script

Syntax Error Near Unexpected Token ' In Shell Script

Contents

An expensive jump with GCC 5.4.0 Why would a NES game use an undocumented 1-byte or 2-byte NOP in production? pid=$(< fooservice.pid) echo "DEBUG: read from file: pid=\"$pid\"" >&2 Bash's printf command has the %q format, which is handy for verifying whether strings are what they appear to be. Remove advertisements Sponsored Links raghunsi View Public Profile Find all posts by raghunsi

Page 1 of 2 1 2 > « Previous Thread | Next Thread » Thread Tools Show Not the answer you're looking for? his comment is here

current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list. share|improve this answer answered Nov 8 '13 at 10:29 chaos 13.8k74360 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign But you may also get the following: : bad interpreter: No such file or directory Why? I got the error like in subject.

Syntax Error Near Unexpected Token Function

How should I tell my employer? Did millions of illegal immigrants vote in the 2016 USA election? Main Menu LQ Calendar LQ Rules LQ Sitemap Site FAQ View New Posts View Latest Posts Zero Reply Threads LQ Wiki Most Wanted Jeremy's Blog Report LQ Bug Syndicate Latest some code ...

Removing brace from the left of dcases Disease that requires regular medicine Idiomatic Expression that basically says "What's bad for you is good for me" Can a free radical be created Beautiful. In your script you're using /bin/sh. /bin/sh apparently is not bash on your system, and the <() syntax is apparently not present in whatever shell /bin/sh is. Syntax Error Near Unexpected Token Ubuntu Does using documentation as a developer make me look unprofessional?

EOF cat «EOF default colors are: ${lc}- shell level color: cyan ${sc}- script name: yellow ${lnc}- line number: red ${fc}- function name: green ${cc}- command executed: white EOF } debug_cmd() { Not the answer you're looking for? So you might have meant: if [[ $a -eq 1 ]]; then echo yes; fi But you could use arithmetic evaluation instead: if ((a == 1)); then echo yes; fi (In zirias View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by zirias 07-10-2010, 02:37 AM #5 grail LQ Guru Registered: Sep 2009 Location:

Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the Bash Syntax Error Near Unexpected Token (' Ubuntu In your interactive bash instance, the shell option extglob is on : $ shopt extglob extglob on Now as your script is running in a subshell, you need to enable extglob Search this Thread 07-09-2010, 01:16 AM #1 rc5gd LQ Newbie Registered: Jul 2010 Posts: 3 Rep: bash: syntax error near unexpected token `(' Hi all, I am new to Can some one suggest me ..

Syntax Error Near Unexpected Token Mac

Wiki syntax is allowed: Please fill all the letters into the box to prove you're human. It's easy to imagine the ^M is bad in other places too. Syntax Error Near Unexpected Token Function command-line bash scripts rm share|improve this question edited Aug 9 '15 at 20:03 guntbert 6,286113159 asked Aug 4 '15 at 10:40 Tal 1522212 unix.stackexchange.com/q/220104/13792 –choroba Aug 4 '15 at Bash Syntax Error Near Unexpected Token $' R'' Lagrange multiplier on unit sphere Does enlarging a character with a reach weapon affect his threat range?

The various parts of the script prompt are printed in color. http://allconverter.net/syntax-error/syntax-error-near-unexpected-token-do-shell.html Note: It seems that here-documents (tested on versions 1.14.7, 2.05b, 3.1.17 and 4.0) are correctly terminated when there is an EOF before the end-of-here-document tag (see redirection). Reason: Fixed code tags Remove advertisements Sponsored Links raghunsi View Public Profile Find all posts by raghunsi

#2 02-03-2010 hergp Problem Eliminator Join An electronics company produces devices that work properly 95% of the time Need a way for Earth not to detect an extrasolar civilization that has radio Binary to decimal converter Is Syntax Error Near Unexpected Token (' Python

To display CRs (these are only a few examples) in VI/VIM: :set list with cat(1): cat -v FILE To eliminate them (only a few examples) blindly with tr(1): tr -d '\r' Browse other questions tagged linux bash shell scripting or ask your own question. What are the ground and flight requirements for high performance endorsement? http://allconverter.net/syntax-error/syntax-error-near-unexpected-token-done-shell-script.html Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community.

here is is before: what where is "the (lost Linux that I want) to find somewhere" in this file and some junk we don't want this thing "here where Linux is Syntax Error Near Unexpected Token C That is because parentheses are used for grouping by the shell such that they are not communicated in any way to a command. Nobody can debug your script without knowing what actually happened and what went wrong.

Join our community today!

If you get weird and illogical messages from your script, rule out the possibility that^M is involved. There's a big difference in the way that UNIX® and Microsoft® (and possibly others) handle the line endings of plain text files. You need to escape them like this: wget http://www.flareget.com/files/flareget/debs/amd64/flareget_2.3-24_amd64\(stable\)_deb.tar.gz Now it should work. Bash Syntax Error Near Unexpected Token Semicolon Real name: E-Mail: Website: Enter your comment.

shopt -s extglob –Tal Aug 4 '15 at 10:48 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. Disable it like this: set +H # or set +o histexpand syntax error near unexpected token `(' When this happens during a script function definition or on the commandline, e.g. $ check over here Browse other questions tagged command-line bash grep regex or ask your own question.

Most useful knowledge from the 30's to understand current state of computers & networking? Then it passes to the python script it takes two strings. #!/bin/bash slice=$1 links=$2 exec `/usr/bin/plcsh /root/gra2.py $slice $links` Thank you --Ram rc5gd View Public Profile View LQ Blog View Why do the Avengers have bad radio discipline? So you have to set NEWFILE=$OUTFILE in the else-part or - if it is OK to run 'chmod' only in the then-block - move 'chmod' just before the 'mv' command: Code:

You are currently viewing LQ as a guest. Plugin for Eclipse. Not the answer you're looking for? How should I tell my employer?

i.e. $ cat originalfile | tr -d "\r" > newfile then it would execute. I used "\" in front of parentheses because they are metacharacters. This can cause much confusion and many headaches, since lines containing CRs are not what they appear to be when printed. share|improve this answer answered Sep 30 '13 at 5:34 slm♦ 171k43322493 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign