Sponsored Content
Top Forums Shell Programming and Scripting Bash (Ubuntu server): Syntax error: "|" unexpected in While-loop Post 302556805 by Corona688 on Monday 19th of September 2011 03:15:03 PM
Old 09-19-2011
You've got ; | If you want to pipe, you shouldn't end in ;, because ; means "end this command and start a new one".

Also, that \ in the middle of the line probably isn't doing what you want. It probably was there originally to combine two lines into one but now it's combining a line you don't want to be part of the statement, "done", into the statement. Ditch it.

I'd reorganize it as this:

Code:
#! /bin/sh
while IFS=';' read  u1 u2 p2
do 
	imapsync --buffersize 8192000 --nosyncacls --subscribe \
                --syncinternaldates --debug --host1 mail.server.com --user1 "$u1" \
                --authuser1 administrator@server.com --password1 Password --ssl1 \
                --port1 993 --host2 mail.server.net --user2 "$u2" --password2 "$p2" \
                --authmech2 PLAIN --ssl2 --port2 993 |
                        tee "$u1".log
done < userinfo.csv
exit

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"syntax error at line 21 :'done' unexpected." error message"

I am trying to run the script bellow but its given me "syntax error at line 20 :'done' unexpected." error message" can someone check to see if the script is ok? and correct me pls. Today is my first day with scripting. Gurus should pls help out #!/bin/ksh # Purpose: Check to see if file... (3 Replies)
Discussion started by: ibroxy
3 Replies

2. Solaris

"syntax error near unexpected token `fi' "

one of my script as follows HOME=/apps/logs mv $HOME/cron.log $HOME/cron.log.`date +%Y-%m-%d` touch $HOME/cron.log fi i am getting error as follows on the last line we are getting ... "syntax error near unexpected token `fi' " please suggest.... (4 Replies)
Discussion started by: GIC1986
4 Replies

3. Shell Programming and Scripting

Syntax error: word unexpected (expecting ")")

I have a very simple script that reads in the contents of a file (_open.txt) into an array "lyrics": #!/bin/sh # read in the text lyrics=( `cat _open.txt` | tr '\n' ' ') exit 0 It gives the following error message: ./lyrics.sh: 1: Syntax error: word unexpected (expecting ")") I have... (9 Replies)
Discussion started by: figaro
9 Replies

4. Shell Programming and Scripting

Syntax error near unexpected token `"Hit <ENTER> to continue:"'

the below code will search attr string inside makefile under the modelno on given path. echo "Enter model no for searching string inside makefile" read inputs2 #find /pools/home_unix/sapte/work/models/model/$inputs2 -name "makefile" | xargs grep "attr" \; #;;I am getting below error.... (7 Replies)
Discussion started by: lathigara
7 Replies

5. Shell Programming and Scripting

Help with error "syntax error: unexpected end of file"

Hi Techies, can anyone please debug the following Script and let me know what is going wrong here. im getting the following error #!/usr/bin/bash # ############################################################################################## # # Variables # #... (2 Replies)
Discussion started by: mahi_mayu069
2 Replies

6. Shell Programming and Scripting

Help with FTP Script which is causing "syntax error: unexpected end of file" Error

Hi All, Please hav a look at the below peice of script and let me know if there are any syntax errors. i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
Discussion started by: mahi_mayu069
1 Replies

7. Shell Programming and Scripting

Error"syntax error at line 15: `end of file' unexpected"

While i m running below code, it is giving me the error"syntax error at line 15: `end of file' unexpected". Pls let me know what is wrong here..i tried many ways, but no luck dbSID="SWQE" usrname="apps" password="Wrgthrk3" count=0 while do sqlplus $usrname/$password@$dbSID... (5 Replies)
Discussion started by: millan
5 Replies

8. UNIX for Dummies Questions & Answers

"Help with bash script" - "License Server and Patch Updates"

Hi All, I'm completely new to bash scripting and still learning my way through albeit vey slowly. I need to know where to insert my server names', my ip address numbers through out the script alas to no avail. I'm also searching on how to save .sh (bash shell) script properly.... (25 Replies)
Discussion started by: profileuser
25 Replies

9. BSD

Keep getting error "-bash: ./.profile_z2: line 52: syntax error: unexpected end of file"

#!/bin/bash #-------------------------------------------------------- # Setup prompt # Author Zeeshan Mirza # Data: 06-08-2017 #-------------------------------------------------------- if then . ./.profile_custom_pre fi umask 022 set -o vi export EDITOR=vi export VISUAL=vi... (3 Replies)
Discussion started by: getzeeshan
3 Replies

10. Shell Programming and Scripting

Error: "Syntax error; unexpected end of file"

Hello all, I am running a script to generate a report and mail it to an email address. When I am trying to validate whether the file is a 0 kb file, I am getting the below error. Error: "Syntax error; unexpected end of file" Any suggestions please? Code: #!/bin/sh .... (1 Reply)
Discussion started by: Pradeep_Raj
1 Replies
ypset(8)						      System Manager's Manual							  ypset(8)

NAME
ypset - point ypbind at a particular server SYNOPSIS
/usr/sbin/ypset [-V1 | -V2] [-d domain] [-h host] server OPTIONS
Bind server for the (old) v.1 NIS protocol. Bind server for the (current) v.2 NIS protocol. If no version is supplied, ypset, first attempts to set the domain for the (current) v.2 protocol. If this attempt fails, ypset, then attempts to set the domain for the (old) v.1 protocol. Set ypbind's binding on host, instead of locally. The host can be spec- ified as a name or as an address. Use domain, instead of the default domain. DESCRIPTION
The ypset command tells ypbind to get Network Information Service (NIS) map information for the specified domain from the ypserv process running on server. If server is down, or isn't running ypserv, this is not discovered until an NIS client process tries to get a binding for the domain. At this point, the binding set by ypset will be tested by ypbind. If the binding is invalid, ypbind will attempt to rebind for the same domain. Note The ypbind process will refuse ypset requests unless -ypset or -ypsetme are specified when ypbind is started. The ypset command is useful for binding a client node which is not on a broadcast net, or is on a broadcast net which isn't running an NIS server host. It also is useful for debugging NIS client applications, for instance where an NIS map only exists at a single NIS server host. In cases where several hosts on the local net are supplying NIS services, it is possible for ypbind to rebind to another host even while you attempt to find out if the ypset operation succeeded. For example, you can type: % ypset host1 % ypwhich host2 which can be confusing. This is a function of the NIS subsystem's attempt to load-balance among the available NIS servers, and occurs when host1 does not respond to ypbind because it is not running ypserv (or is overloaded), and host2, running ypserv, gets the binding. The server indicates the NIS server to bind to, and can be specified as a name or an address. If specified as a name, ypset will attempt to use NIS services to resolve the name to an address. This will work only if the node has a current valid binding for the domain in ques- tion. In most cases, server should be specified as an address. Refer to ypfiles(4) and ypserv(8) for an overview of NIS. SEE ALSO
Commands: ypwhich(1), ypserv(8) Files: ypfiles(4) ypset(8)
All times are GMT -4. The time now is 07:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy