Read on full site | Join TechSpot! (it's free) | Bookmark / Share this



input/output redirection

deki
11-24-2005, 12:53 AM
Hi, I need some help with ksh scripting
i have script in which i search for users on command line then in for loop check are they
logged on then i try to send them message:
set brcp4 dxmm4 -m hello just testing program
USERS=`echo $* | sed 's/.*cp4\([^-]*\).*/\1/'
for i in $USERS
tty=`finger | grep $i | cut -c 32-38
write $i $tty <<+ <--------here it tells me "<<" is unmatched? what does it mean?
hello just testing program
+
done
any help why is input redirection tells me unmatched?I need help asap.Thank you.

Nodsu
11-24-2005, 04:23 AM
You have some problems with for syntax and backticks.

Try something like this:
#!/bin/ksh
USERS=`echo $* | sed 's/.*cp4\([^-]*\).*/\1/'`
for i in $USERS ; do
tty=`finger | grep $i | cut -c 32-38`
write $i $tty <<+
hello just testing program
+
done

Ad
11-24-2005, 04:23 AM
  

deki
12-02-2005, 08:27 PM
Thanks I got it fixed!

Post a reply, see related topics & more

Tip: Download Advanced SystemCare 3 Free - Clean, Repair, Protect & Optimize your PC.



 Top Technology News

Weekend Open Forum: Google Chrome OS and the future of cloud computing

Tech Tip of the Week: Unearth Region-Specific Windows 7 Themes

Sony: PlayStation 3 to be 3D-capable via firmware update

iSuppli: DDR3 to account for over half of DRAM shipments by Q2 2010

Facebook named third most popular video website behind YouTube and Hulu

Patriot introduces new PS-100 SSD series

Sony working on digital store for music, movies, books

Details of Intel's 32nm Atom emerge, on track for 2011

More Tech News

  
 Software Downloads

Norton Virus Definitions 2003-07 November 20, 2009

AVG Anti-Virus Updates November 20, 2009

Norton Virus Definitions 2008-09 November 20, 2009

avast! Virus Definitions November 20, 2009

McAfee SuperDAT Update 5808

Kaspersky Anti-Virus Update November 20, 2009

Google SketchUp 7.1.6087

More Downloads



Copyright © 1998-2009 TechSpot.com. TechSpot is a registered trademark. All Rights Reserved.