Sponsored Content
Top Forums UNIX for Advanced & Expert Users sed: -e expression #1, char 0: no previous regular expression Post 302688635 by InduInduIndu on Sunday 19th of August 2012 09:17:35 PM
Old 08-19-2012
sed: -e expression #1, char 0: no previous regular expression

Thanks RudiC for your response.
I verified the points you have highlighted, and there is no problem with array size & initialization.Anyways, i can assign array size to another variable and use it in while condition.
I'd want you just focus on sed part of it, as it throws error there.

Hope you got me right!

Regards,
Indu
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Regular expression with sed

Hi, I'm trying following:echo "test line XA24433 test" | sed 's/.*X\(.*\)/X\1/' XA24433 test While I want the output as: XA24433 I want to grab the words starting with letter X till the next space, this word can be anywhere in the line. (9 Replies)
Discussion started by: nervous
9 Replies

2. Shell Programming and Scripting

Regular expression with SED

Hi! I'm trying to write a regexp but I have no luck... I have a string like this: param1=sometext&param2=hello&param3=bye Also, the string can be simply: param2=hello I want to return the value of param2: "hello". How can I do this? Thanks. (3 Replies)
Discussion started by: GagleKas
3 Replies

3. Shell Programming and Scripting

Regular expression (sed)

Hi I need to get text that are within "" For example File: asdasd "test test2" sadasds asdda asdasd "demo demo2" Output: test test2 demo demo2 Any help is good Thank you (12 Replies)
Discussion started by: blito_loco
12 Replies

4. Shell Programming and Scripting

sed regular expression help

please consider this: echo "11111*X*005010X279~ST*270*1111111*005010X279~BHT*0011*11" | sed 's/.*\(005010X(\d)(\d)(\d)*\).*$/\1/'i'm searching for first occurrence of 005010X while leaving rest of characters out. :confused: any tips? thnx in advance guys. (7 Replies)
Discussion started by: grep01
7 Replies

5. Shell Programming and Scripting

Integer expression expected: with regular expression

CA_RELEASE has a value of 6. I need to check if that this is a numeric value. if not error. source $CA_VERSION_DATA if * ] then echo "CA_RELESE $CA_RELEASE is invalid" exit -1 fi + source /etc/ncgl/ca_version_data ++ CA_PRODUCT_ID=samxts ++ CA_RELEASE=6 ++ CA_WEEK_NO=7 ++... (3 Replies)
Discussion started by: ketkee1985
3 Replies

6. UNIX for Dummies Questions & Answers

Regular Expression In Sed

Hi , I am learing sed echo abc 123 def 456 | sed 's|\(*\) \(*\)|\1|' is returning abc def 456 i was hoping abc def "\1" should only print the occurence of the first pattern but according to my understanding it is just removing the first occurence of the second pattern... (7 Replies)
Discussion started by: max_hammer
7 Replies

7. Shell Programming and Scripting

sed: -e expression #1, char 21: unterminated `s' command

I have read many threads, but I still didn't find the right answer. May be i didn't find the right thread, though are so many threads for the same question. Basically the situation is - find date in a file and replace it with another date. (its not homework, its part of lot of a big processing,... (10 Replies)
Discussion started by: avinthm
10 Replies

8. Programming

Perl: How to read from a file, do regular expression and then replace the found regular expression

Hi all, How am I read a file, find the match regular expression and overwrite to the same files. open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat"; open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat"; while (<DESTINATION_FILE>) { # print... (1 Reply)
Discussion started by: jessy83
1 Replies

9. Shell Programming and Scripting

sed regular expression

Hi , I need to remove pipe character from a |^ delimeted file. Something like |^tran|sformers||^|revenge |of fallen|^ to |^transformers|^revenge of fallen|^... Cold anybody please help to build the regular expression using sed . many thanks. Please use code tags next time for... (1 Reply)
Discussion started by: kokjek
1 Replies
XSetInputFocus()														  XSetInputFocus()

Name
  XSetInputFocus - set the keyboard focus window.

Synopsis
  XSetInputFocus(display, focus, revert_to, time)
	Display *display;
	Window focus;
	int revert_to;
	Time time;

Arguments
  display  Specifies a connection to an X server; returned from XOpenDisplay().

  focus    Specifies the ID of the window you want to be the keyboard focus.  Pass the window ID, PointerRoot, or None.

  revert_to
	   Specifies  which  window  the  keyboard  focus  reverts to if the focus window becomes not viewable.  Pass one of these constants:
	   RevertToParent, RevertToPointerRoot, or RevertToNone.  Must not be a window ID.

  time	   Specifies the time when the focus change should take place.	Pass either a timestamp, expressed in milliseconds, or	the  constant
	   CurrentTime.  Also returns the time of the focus change when CurrentTime is specified.

Description
  XSetInputFocus() changes the keyboard focus and the last-focus-change time.  The function has no effect if time is earlier than the current
  last-focus-change time or later than the current X server time.  Otherwise, the last-focus-change time is set to the specified  time,  with
  CurrentTime replaced by the current X server time.

  XSetInputFocus() generates FocusIn and FocusOut events if focus is different from the current focus.

  XSetInputFocus() executes as follows, depending on what value you assign to the focus argument:

  o  If you assign None, all keyboard events are discarded until you set a new focus window.  In this case, revert_to is ignored.

  o  If  you  assign  a  window ID, it becomes the main keyboard's focus window.  If a generated keyboard event would normally be reported to
     this window or one of its inferiors, the event is reported normally; otherwise, the event is reported to the focus window.   The  speci-
     fied  focus window must be viewable at the time of the request (else a BadMatch error).  If the focus window later becomes not viewable,
     the focus window will change to the revert_to argument.

  o  If you assign PointerRoot, the focus window is dynamically taken to be the root window of whatever screen the pointer is on at each key-
     board event.  In this case, revert_to is ignored.	This is the default keyboard focus setting.

  If the focus window later becomes not viewable, XSetInputFocus() evaluates the revert_to argument to determine the new focus window:

  o  If  you  assign  RevertToParent,  the  focus reverts to the parent (or the closest viewable ancestor) automatically with a new revert_to
     argument of RevertToName.

  o  If you assign RevertToPointerRoot or RevertToNone, the focus reverts to that value automatically.	FocusIn and FocusOut events are  gen-
     erated when the focus reverts, but the last focus change time is not affected.

Errors
  BadMatch  focus window not viewable when XSetInputFocus() called.

  BadValue

  BadWindow

See Also
  XQLength(),	XAllowEvents(),   XCheckIfEvent(),   XCheckMaskEvent(),  XCheckTypedEvent(),  XCheckTypedWindowEvent(),  XCheckWindowEvent(),
  XEventsQueued(), XGetInputFocus(), XGetMotionEvents(), XIfEvent(), XMaskEvent(), XNextEvent(),  XPeekEvent(),  XPeekIfEvent(),  XPending(),
  XPutBackEvent(), XSelectInput(), XSendEvent(), XSynchronize(), XWindowEvent().

Xlib - Input Handling														  XSetInputFocus()
All times are GMT -4. The time now is 05:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy