03-14-2018
I am guessing you intended to use extended regex. This requires that you escape characters with special meaning - like the ) character -> \)
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm getting the following error:
line 21: syntax error near unexpected token `done`
line 21: `done`
and I haven't been able to figure out why.
Here is my code
#!/bin/sh
if ; then
echo 'Usage: rename getexp/replStr '
exit 0
fi
arg = $1
shift
while ; do (5 Replies)
Discussion started by: NullPointer
5 Replies
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
Hi all,
Here is a simple script that is working in one server and is giving a syntax error in other server. Can somebody help me ?
#!/bin/bash
# ftp files
done < $file
errors:
I tried..with no success:
if ; then (21 Replies)
Discussion started by: Lenora2009
21 Replies
4. Shell Programming and Scripting
Hi all,
This is a script which converts hex to bin. However am finding an error while executing
syntax error near unexpected token `='
`($hexfile, $binfile) = @ARGV;'
I am running using ./fil.pl <hexfile> <binfile>
###################################################
#
# this script... (3 Replies)
Discussion started by: jaango123
3 Replies
5. Shell Programming and Scripting
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
6. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
line 37: syntax error near unexpected token 'else'
line 37: ' else'
the script is made to take 1 or 2 command line arguments however i get the above stated error when trying to process it. This happens with or without arguments... (6 Replies)
Discussion started by: Ren_kun
6 Replies
7. Shell Programming and Scripting
Hi,
I am trying to read the session log through script. But it keeps showing me some error near. I have tried everything. Even tried converting the script using sed command to remove the hidden characters(\r).But nothing seems to be working.Below is the script :
#!/bin/bash
cd... (6 Replies)
Discussion started by: Aryan12345
6 Replies
8. Shell Programming and Scripting
Hi all,
I have a simple script that doesn't work somehow. I can't seem to be spotting the cause of the malfunction.
count=$((1))
for item in `cat test1.txt`
printf %s `sed -n $((count))p test2.txt` > test3.txt
count=$((count+1))
do
something
done
I get ;
./why.sh: line 3:... (14 Replies)
Discussion started by: y33t
14 Replies
9. UNIX for Beginners Questions & Answers
Hello all,
Please i have this command i used to zip different files in differents directory, but i have an error. Note that when i run the command in one directory it works fine.
/X5/WORK/BGH/INV/REG/pdf/SEND/BGH12523/1/*.fo
/X5/WORK/BGH/INV/REG/pdf/SEND/BGH24523/1/*.fo... (3 Replies)
Discussion started by: gillesi
3 Replies
10. UNIX for Beginners Questions & Answers
Dears,
While executing the below script im getting the error at line 30. Please let me know what changes to be done to fix this.
test.sh: line 30: syntax error near unexpected token `done'
test.sh: line 30: ` done '
#!/bin/sh
# Rev. PA1
# author: eillops
# date: 26-04-2018
#
#... (1 Reply)
Discussion started by: Kamesh G
1 Replies
LEARN ABOUT MOJAVE
fparseln
FPARSELN(3) BSD Library Functions Manual FPARSELN(3)
NAME
fparseln -- return the next logical line from a stream
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdio.h>
#include <util.h>
char *
fparseln(FILE *stream, size_t *len, size_t *lineno, const char delim[3], int flags);
DESCRIPTION
The fparseln() function returns a pointer to the next logical line from the stream referenced by stream. This string is NUL terminated and
it is dynamically allocated on each invocation. It is the responsibility of the caller to free the pointer.
By default, if a character is escaped, both it and the preceding escape character will be present in the returned string. Various flags
alter this behaviour.
The meaning of the arguments is as follows:
stream The stream to read from.
len If not NULL, the length of the string is stored in the memory location to which it points.
lineno If not NULL, the value of the memory location to which is pointed to, is incremented by the number of lines actually read from the
file.
delim Contains the escape, continuation, and comment characters. If a character is NUL then processing for that character is disabled. If
NULL, all characters default to values specified below. The contents of delim is as follows:
delim[0] The escape character, which defaults to , is used to remove any special meaning from the next character.
delim[1] The continuation character, which defaults to , is used to indicate that the next line should be concatenated with the
current one if this character is the last character on the current line and is not escaped.
delim[2] The comment character, which defaults to #, if not escaped indicates the beginning of a comment that extends until the end
of the current line.
flags If non-zero, alter the operation of fparseln(). The various flags, which may be or-ed together, are:
FPARSELN_UNESCCOMM Remove escape preceding an escaped comment.
FPARSELN_UNESCCONT Remove escape preceding an escaped continuation.
FPARSELN_UNESCESC Remove escape preceding an escaped escape.
FPARSELN_UNESCREST Remove escape preceding any other character.
FPARSELN_UNESCALL All of the above.
RETURN VALUES
Upon successful completion a pointer to the parsed line is returned; otherwise, NULL is returned.
The fparseln() function uses internally fgetln(3), so all error conditions that apply to fgetln(3), apply to fparseln(). In addition
fparseln() may set errno to ENOMEM and return NULL if it runs out of memory.
SEE ALSO
fgetln(3)
HISTORY
The fparseln() function first appeared in NetBSD 1.4.
BSD
December 1, 1997 BSD