Sponsored Content
Full Discussion: Syntax error: Unexpected '('
Top Forums Shell Programming and Scripting Syntax error: Unexpected '(' Post 303045005 by sea on Tuesday 10th of March 2020 03:31:52 PM
Old 03-10-2020
Thank you stomp

I was 100% sure...
As it used to work yesterday - or I've must have overseen this message due to all other error messages... Smilie
Code:
[sea@manjaro-desktop SWARM]$ grep traps_ ../tui/scripts/*
grep: ../tui/scripts/distro: Ist ein Verzeichnis
../tui/scripts/gen-tuirc.sh:	traps_save(){ saved_traps=\$(trap) ; export

As you see, it's the exact same code, that had worked for over a year (5 years ago).
Maybe there was a security update or something?

But now thinking about it....
:doh:
That genrc.sh was to, well, generate an RC file, for which of course the $ had to be escaped....
Now, it's in the actual script already -> no need to escape...

Thanks a bunch again stomp! Smilie

/solved

Last edited by sea; 03-10-2020 at 06:21 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sh: syntax error: `...' unexpected???

Hello all, I want to create a script that polls every hour a directory for the existence of a file. The file I look for is a `token` dropped by an external process at the completion of a successful FTP process. I wrote this script `checkfile.ksh`: #!/usr/bin/ksh if ] then mailx... (5 Replies)
Discussion started by: alan
5 Replies

2. Shell Programming and Scripting

unexpected syntax error

Hi, i am getting following syntax error ...kingly advice why is it coming ?? #!/bin/bash find . -name "common.log" if ; then echo "1" fi Himnashu@home /bin $ ./a.sh ./a.sh: line 7: syntax error near unexpected token `fi' ./a.sh: line 7: `fi' (9 Replies)
Discussion started by: himvat
9 Replies

3. UNIX for Advanced & Expert Users

Syntax error near unexpected token

Hi, When I run the below shell script I'm getting the error " syntax error near unexpected token `" Script: REM :: File Name : Refresh_OTL.bat REM :: Parameters : %1 - Region REM :: : %2 - Cube Type REM :: : REM :: Notes : REM ============================== set ENVIRONMENT... (2 Replies)
Discussion started by: tomailraj
2 Replies

4. Shell Programming and Scripting

Syntax error near unexpected token `('

Guys , This is an output of my script errored out for "Syntax error near unexpected token `(' " Can someone tell me whats wrong with my script. Below is my original script pasted. #!/bin/bash Script Creation Date 01/21/2010 Author baraghun ... (7 Replies)
Discussion started by: raghunsi
7 Replies

5. Shell Programming and Scripting

syntax error: `$' unexpected

Hi all, Am very new to Unix and am currently Involved in Migrating some Shell Scripts from AIX 4 to Solaris 10. While using teh for loop am getting the below error: $ echo $SHELL /usr/bin/ksh $ for file in $(ls *SEBE*) syntax error: `$' unexpected while the same works without issue on... (4 Replies)
Discussion started by: paragkhanore
4 Replies

6. Shell Programming and Scripting

ksh syntax error: `(' unexpected

So I am trying to convert my bash script into ksh, and this is what I have in the file so far: #!/bin/ksh login() { if then sendcmd BETA else sendcmd "$(xxd -c 32 -g 0 ${ZETA_ZETA} | awk '{print $2}')" fi } But when I run it: $ ./test.sh ... (1 Reply)
Discussion started by: guitarscn
1 Replies

7. Shell Programming and Scripting

Syntax error near unexpected token `}' please help

I'm going mad not being able to get this to work. im assuming its only a simple mistake but its driving me bonkers trying to find it. Please if you can help me it would save me pulling my hair out!! Thanks #!/bin/bash -xv # #Config name="TEST Server" + name='TEST Server'... (6 Replies)
Discussion started by: Fisheh
6 Replies

8. Shell Programming and Scripting

Syntax error: 'fi' unexpected

unzip file.zip if ] ; then echo "Success" else echo "Some failure." fi ; I tried many time to detect the unzip error, but it keep show the syntax error wherever how I change the syntac. Hope someone can help me fix the issue, thanks. Please use code tags next time for your code and... (5 Replies)
Discussion started by: duncanyy
5 Replies

9. Shell Programming and Scripting

Syntax error `(' unexpected

I have written this in my script but while running i am getting syntax error `(' unexpected. unload to "$BACKUP_DIR/n_fac_fid-$clliname" select * from n_fac_fid where fac_accesskey in (select fac_accesskey From n_fac_ap_fid where ap_clli="$clliname"); Any help appreciated. (3 Replies)
Discussion started by: suryanmi
3 Replies

10. Shell Programming and Scripting

Syntax error: `]' unexpected

I am getting this error Syntax error: `]' unexpected. Did I do something wrong with elif? Does ksh not like double brackets? if ]; then #echo hi source ~/.bashrc; elif ]; then #echo hi source ~/.kshrc; fi (5 Replies)
Discussion started by: cokedude
5 Replies
STOMP_READ_FRAME(3)							 1						       STOMP_READ_FRAME(3)

Stomp::readFrame - Reads the next frame

       Object oriented style (method):

SYNOPSIS
public stompframe Stomp::readFrame ([string $class_name = "stompFrame"]) DESCRIPTION
Procedural style: array stomp_read_frame (resource $link) Reads the next frame. It is possible to instantiate an object of a specific class, and pass parameters to that class's constructor. PARAMETERS
o $link -Procedural style only: The stomp link identifier returned by stomp_connect(3). o $class_name - The name of the class to instantiate. If not specified, a stompFrame object is returned. RETURN VALUES
Note A transaction header may be specified, indicating that the message acknowledgment should be part of the named transaction. CHANGELOG
+------------+----------------------------------+ | Version | | | | | | | Description | | | | +------------+----------------------------------+ |Stomp 0.4.0 | | | | | | | $class_name parameter was added. | | | | +------------+----------------------------------+ EXAMPLES
Example #1 Object oriented style <?php /* connection */ try { $stomp = new Stomp('tcp://localhost:61613'); } catch(StompException $e) { die('Connection failed: ' . $e->getMessage()); } /* subscribe to messages from the queue 'foo' */ $stomp->subscribe('/queue/foo'); /* read a frame */ var_dump($stomp->readFrame()); /* close connection */ unset($stomp); ?> The above example will output something similar to: object(StompFrame)#2(3) { ["command"]=> string(7) "MESSAGE" ["headers"]=> array(5) { ["message-id"]=> string(41) "ID:php.net-55293-1257226743606-4:2:-1:1:1" ["destination"]=> string(10) "/queue/foo" ["timestamp"]=> string(13) "1257226805828" ["expires"]=> string(1) "0" ["priority"]=> string(1) "0" } ["body"]=> string(3) "bar" } Example #2 Procedural style <?php /* connection */ $link = stomp_connect('ssl://localhost:61612'); /* check connection */ if (!$link) { die('Connection failed: ' . stomp_connect_error()); } /* subscribe to messages from the queue 'foo' */ stomp_subscribe($link, '/queue/foo'); /* read a frame */ $frame = stomp_read_frame($link); /* close connection */ stomp_close($link); ?> The above example will output something similar to: array(3) { ["command"]=> string(7) "MESSAGE" ["body"]=> string(3) "bar" ["headers"]=> array(6) { ["transaction"]=> string(2) "t1" ["message-id"]=> string(41) "ID:php.net-55293-1257226743606-4:3:-1:1:1" ["destination"]=> string(10) "/queue/foo" ["timestamp"]=> string(13) "1257227037059" ["expires"]=> string(1) "0" ["priority"]=> string(1) "0" } } PHP Documentation Group STOMP_READ_FRAME(3)
All times are GMT -4. The time now is 06:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy