Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Files with special characters - how to remove Post 302426868 by newbie_01 on Thursday 3rd of June 2010 06:39:54 AM
Old 06-03-2010
Files with special characters - how to remove

Hi,

I have a directory that has a file which contained special characters in the filename. Can someone please advise how to remove the file, preferably with a rm -i ?

Thanks in advance.

Listing is as below:

{oracle}> ls -1b
bplog.bkup.001
bplog.bkup.002
bplog.bkup.003
bplog.bkup.004
bplog.bkup.005
bplog.bkup.006
bplog.bkup.007
bplog.bkup.008
local.cshrc
local.login
local.profile
oraenv.list
repo
response
runInstaller
stage
welcome.html
\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177p>
{oracle}>
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Remove directory that has special Characters

Hi All, I have a script written that creates a new directory within the shell program and if a parameter isn't passed in, it creates a strange directory name by mistake. So I have a directory like "-_12" and I am unable to remove it. I tried removing it using double quote and many others. I have... (12 Replies)
Discussion started by: datherriault
12 Replies

2. Shell Programming and Scripting

Remove special characters from string

Hi there, I'd like to write a script that removes any set of character from any string. The first argument would be the string, the second argument would be the characters to remove. For example: $ myscript "My name's Santiago. What's yours?" "atu" My nme's Snigo. Wh's yors? I wrote the... (11 Replies)
Discussion started by: chebarbudo
11 Replies

3. Shell Programming and Scripting

How to remove special characters from each line?

Hello, Is there a simpler way to remove special characters (color codes) from each lines in a log file? I use sed like in the example below but I think there should be a more simple way to achieve the same result: $ cat -vet file1 ^, , , , Maybe to convert the file somehow? ... (5 Replies)
Discussion started by: majormark
5 Replies

4. UNIX for Dummies Questions & Answers

How to Remove Special Characters

Dear Members, We have a file which contains some special characters. I need to replace these special character by a new line character(\n). The Special character is \x85. I am not sure what this character means and how we can remove it. Any inputs are greatly appreciated. Thanks... (5 Replies)
Discussion started by: sandeep_1105
5 Replies

5. Shell Programming and Scripting

remove special characters

hello all I am writing a perl code and i wish to remove the special characters for text. I wish to remove all extended ascii characters. If the list of special characters is huge, how can i do this using substitute command s/specialcharacters/null/g I really want to code like... (3 Replies)
Discussion started by: vasuarjula
3 Replies

6. Shell Programming and Scripting

Remove string between two special characters

Hi All, I have a variable like AVAIL="\ BACK:bkpstg:testdb3.iad.expertcity.com:backtest|\ #AUTH:authstg:testdb3.iad.expertcity.com:authiapd|\ TEST:authstg:testdb3.iad.expertcity.com:authiapd|\ " What I want to do here is that If a find # before any entry, remove the entire string... (5 Replies)
Discussion started by: engineermayur
5 Replies

7. Shell Programming and Scripting

Remove the special characters from field

Hi, In source data few of columns are having special charates(like *) due to this i am not able to display the data into flat file.it's displaying the some of junk data into the flat file. source dataExample: Address1="XDERFTG * HYJUYTG" how to remove the special charates in a string (2 Replies)
Discussion started by: koti_rama
2 Replies

8. Shell Programming and Scripting

Sed - remove special characters

Hi, I have a file with this line, it's always in the first line: I want to remove these special characters: ´╗┐ file1 ´╗┐\\bar\c$\test2\;3.348.118 Bytes;160 ;3 \\bar\c$\test\;35 Bytes;2 ;1 I want the same file to be only \\bar\c$\test2\;3.348.118 Bytes;160 ;3 \\bar\c$\test\;35... (4 Replies)
Discussion started by: nakaedu
4 Replies

9. Shell Programming and Scripting

How to remove some special characters in a string?

Hi, I have string like this ="Lookup Procedure" But i want the output like this Lookup Procedure =," should be removed. Please suggest me the solution. Regards, Madhuri (2 Replies)
Discussion started by: srimadhuri
2 Replies

10. Shell Programming and Scripting

How to remove special characters?

Hi Gurus, I have file which contains some unicode charachator like "ü". I want to replace it with some charactors. I searched in internet and got command sed "s/ü/-/g", but I don't know how to type ü in unix command line. Please help me for this one. Thanks in advance (7 Replies)
Discussion started by: ken6503
7 Replies
irb-beta(1)						      General Commands Manual						       irb-beta(1)

What is irb?
       irb stands for `interactive ruby'. irb is a tool to execute interactively ruby expressions read from stdin.

Invoking
	   % ruby -r irb -e0
	   % irb
       Either of the aboves. In the former style, options can be specified as follows:
	   % ruby -r irb -e0 -- -v

Usage
       Use  of irb is easy if you know ruby.  Executing irb, prompts are displayed as follows. Then, enter expression of ruby. A input is executed
       when it is syntacticaly completed.
	   dim% irb
	   irb(main):001:0> 1+2
	   3
	   irb(main):002:0> class Foo
	   irb(main):003:1>  def foo
	   irb(main):004:2>    print 1
	   irb(main):005:2>  end
	   irb(main):006:1> end
	   nil
	   irb(main):007:0>
       And, Readline extesion module can be used with irb. Using Readline is the standard default action if Readline is installed.

Command line option
	   irb.rb [options] file_name opts
	   options:
	   -f		  suppress read ~/.irbrc
	   -m		  bc mode (fraction or matrix are available)
	   -d		     set $DEBUG  to true (same as `ruby -d')
	   -r load-module    same as `ruby -r'
	   --inspect	  uses `inspect' for output (the default except bc mode)
	   --noinspect	       doesn't uses inspect for output
	   --readline	  uses Readline extension module
	   --noreadline        doesn't use Readline extension module
	   --prompt prompt-mode
	   --prompt-mode prompt-mode
	   switches prompt mode. Pre-defined prompt modes are
	   `defalut', `simple', `xmp' and `inf-ruby'
	   --inf-ruby-mode   uses prompt appreciate for inf-ruby-mode on emacs.
	   Suppresses --readline.
	   --simple-prompt   simple prompt mode
	   --noprompt	  no prompt
	   --tracer	  display trace for each execution of commands.
	   --back-trace-limit n
	   displayes backtrace top n and tail n. The default
	   value is 16.
	   --irb_debug n       sets internal debug level to n (It shouldn't be used)
	   -v, --version       prints the version of irb

Configurations
       irb reads `~/.irbrc' when it is invoked. If `~/.irbrb' doesn't exist irb try to	read  in  the  order  `.irbrc',  `irb.rc',  `_irbrc'  then
       `$irbrc'.  The following is altanative to the command line option. To use them type as follows in an irb session.
	   IRB.conf[:IRB_NAME]="irb"
	   IRB.conf[:MATH_MODE]=false
	   IRB.conf[:USE_TRACER]=false
	   IRB.conf[:USE_LOADER]=false
	   IRB.conf[:IGNORE_SIGINT]=true
	   IRB.conf[:IGNORE_EOF]=false
	   IRB.conf[:INSPECT_MODE]=nil
	   IRB.conf[:IRB_RC] = nil
	   IRB.conf[:BACK_TRACE_LIMIT]=16
	   IRB.conf[:USE_LOADER] = false
	   IRB.conf[:USE_READLINE] = nil
	   IRB.conf[:USE_TRACER] = false
	   IRB.conf[:IGNORE_SIGINT] = true
	   IRB.conf[:IGNORE_EOF] = false
	   IRB.conf[:PROMPT_MODE] = :DEFALUT
	   IRB.conf[:PROMPT] = {...}
	   IRB.conf[:DEBUG_LEVEL]=0
	   IRB.conf[:VERBOSE]=true

Customizing prompt
       To costomize the prompt you set a variable
	   IRB.conf[:PROMPT]
       For example, describe as follows in `.irbrc'.
	   IRB.conf[:PROMPT][:MY_PROMPT] = { # name of prompt mode
	     :PROMPT_I => nil,	       # normal prompt
	     :PROMPT_S => nil,	       # prompt for continuated strings
	     :PROMPT_C => nil,	       # prompt for continuated statement
	     :RETURN => "    ==>%s
"	    # format to return value
	   }
       Then, invoke irb with the above prompt mode by
	   % irb --prompt my-prompt
       Or add the following in `.irbrc'.
	   IRB.conf[:PROMPT_MODE] = :MY_PROMPT
       Constants PROMPT_I, PROMPT_S and PROMPT_C specifies the format.	In the prompt specification, some special strings are available.
	   %N	 command name which is running
	   %m	 to_s of main object (self)
	   %M	 inspect of main object (self)
	   %l	 type of string(", ', /, ]), `]' is inner %w[...]
	   %NNi  indent level. NN is degits and means as same as printf("%NNd").
		 It can be ommited
	   %NNn  line number.
	   %%	 %
       For instance, the default prompt mode is defined as follows: IRB.conf[:PROMPT_MODE][:DEFAULT] = {

       PROMPT_I => "%N(%m):%03n:%i> ",

       PROMPT_S => "%N(%m):%03n:%i%l ",

       PROMPT_C => "%N(%m):%03n:%i* ",

       RETURN => "%s
"
	      } RETURN is used to printf.

Configurating subirb
       The  command  line option or IRB.conf specify the default behavior of (sub)irb. On the other hand, each conf of in the next sction `6. Com-
       mand' is used to individually configurate (sub)irb.  If proc is set to IRB.conf[:IRB_RC], its subirb will be  invoked  after  execution	of
       that proc under giving the context of irb as its aregument. By this mechanism each subirb can be configurated.

Command
       For irb commands, both simple name and `irb_'-prefixed name are prepared.

       exit, quit, irb_exit
	      Quits (sub)irb.  if you've done cb (see below), exit from the binding mode.

       conf, irb_context
	      Displays current configuration. Modifing the configuration is achieved by sending message to `conf'.

       conf.back_trace_limit
	      Sets display lines of backtrace as top n and tail n.  The default value is 16.

       conf.debug_level = N
	      Sets debug level of irb.

       conf.ignore_eof = true/false
	      Whether ^D (control-d) will be ignored or not.  If false is set, ^D means quit.

       conf.ignore_sigint= true/false
	      Whether ^C (control-c) will be ignored or not.  If false is set, ^D means quit.  If true,

		  during input:   cancel inputing then return to top level.
		  during execute: abondon current execution.

       conf.inf_ruby_mode = true/false
	      Whether inf-ruby-mode or not. The default value is false.

       conf.inspect_mode = true/false/nil
	      Specifies inspect mode.  true:  display inspect false: display to_s nil:	 inspect mode in non math mode,

		  non inspect mode in math mode.

       conf.irb_level
	      The level of cb.

       conf.math_mode
	      Whether bc mode or not.

       conf.use_loader = true/false
	      Whether irb's own file reader method is used when load/require or not.  This mode is globaly affected (irb wide).

       conf.prompt_c
	      prompt for a continuating statement (e.g, immediately after of `if')

       conf.prompt_i
	      standard prompt

       conf.prompt_s
	      prompt for a continuating string

       conf.rc
	      Whether ~/.irbrc is read or not.

       conf.use_prompt = true/false
	      Prompting or not.

       conf.use_readline = true/false/nil
	      Whether readline is used or not.	true: uses false: doen't use nil: intends to use readline except for inf-reuby-mode (default)

       conf.verbose=T/F
	      Whether verbose messages are display or not.

       cb, irb_change_binding [obj]
	      Enter new binding which has a distinct scope of local variables.	If obj is given, obj will be self.

       irb [obj]
	      Invoke subirb. If obj is given, obj will be self.

       jobs, irb_jobs
	      List of subirb

       fg n, irb_fg n
	      Switch into specified subirb. The following is candidates of n:

		  irb number
		  thhread
		  irb object
		  self(obj which is specified of irb obj)

       kill n, irb_kill n
	      Kill subirb. The means of n is as same as the case of irb_fg.

System variable
	   _  The latest value of evaluation (it is local)

Session Example
	   dim% ruby irb.rb
	   irb(main):001:0> irb 		       # invoke subirb
	   irb#1(main):001:0> jobs		       # list of subirbs
	   #0->irb on main (#<Thread:0x400fb7e4> : stop)
	   #1->irb#1 on main (#<Thread:0x40125d64> : running)
	   nil
	   irb#1(main):002:0> fg 0		       # switch job
	   nil
	   irb(main):002:0> class Foo;end
	   nil
	   irb(main):003:0> irb Foo		       # invoke subirb which has the
	   #		  context of Foo
	   irb#2(Foo):001:0> def foo		       # define Foo#foo
	   irb#2(Foo):002:1>   print 1
	   irb#2(Foo):003:1> end
	   nil
	   irb#2(Foo):004:0> fg 0		       # switch job
	   nil
	   irb(main):004:0> jobs		       # list of job
	   #0->irb on main (#<Thread:0x400fb7e4> : running)
	   #1->irb#1 on main (#<Thread:0x40125d64> : stop)
	   #2->irb#2 on Foo (#<Thread:0x4011d54c> : stop)
	   nil
	   irb(main):005:0> Foo.instance_methods       # Foo#foo is defined asurely
	   ["foo"]
	   irb(main):006:0> fg 2		       # switch job
	   nil
	   irb#2(Foo):005:0> def bar		       # define Foo#bar
	   irb#2(Foo):006:1>  print "bar"
	   irb#2(Foo):007:1> end
	   nil
	   irb#2(Foo):010:0>  Foo.instance_methods
	   ["bar", "foo"]
	   irb#2(Foo):011:0> fg 0
	   nil
	   irb(main):007:0> f = Foo.new
	   #<Foo:0x4010af3c>
	   irb(main):008:0> irb f		       # invoke subirb which has the
	   #  context of f (instance of Foo)
	   irb#3(#<Foo:0x4010af3c>):001:0> jobs
	   #0->irb on main (#<Thread:0x400fb7e4> : stop)
	   #1->irb#1 on main (#<Thread:0x40125d64> : stop)
	   #2->irb#2 on Foo (#<Thread:0x4011d54c> : stop)
	   #3->irb#3 on #<Foo:0x4010af3c> (#<Thread:0x4010a1e0> : running)
	   nil
	   irb#3(#<Foo:0x4010af3c>):002:0> foo	       # evaluate f.foo
	   1nil
	   irb#3(#<Foo:0x4010af3c>):003:0> bar	       # evaluate f.bar
	   barnil
	   irb#3(#<Foo:0x4010af3c>):004:0> kill 1, 2, 3# kill job
	   nil
	   irb(main):009:0> jobs
	   #0->irb on main (#<Thread:0x400fb7e4> : running)
	   nil
	   irb(main):010:0> exit		       # exit
	   dim%

Restrictions
       Because	irb  evaluates	the inputs immediately after the imput is syntactically completed, irb gives slight different result than directly
       use ruby. Known difference is pointed out here.

Declaration of the local variable
       The following causes an error in ruby:
	   eval "foo = 0"
	   foo
	   --
	   -:2: undefined local variable or method `foo' for #<Object:0x40283118> (NameError)
	   ---
	   NameError
       Though, the above will successfully done by irb.
	   >> eval "foo = 0"
	   => 0
	   >> foo
	   => 0
       Ruby evaluates a code after reading entire of code and determination of the scope of local variables. On the other  hand,  irb  do  immedi-
       ately. More precisely, irb evaluate at first
	   evel "foo = 0"
       then  foo  is defined on this timing. It is because of this incompatibility.  If you'd like to detect those differences, begin...end can be
       used:
	   >> begin
	   ?>	eval "foo = 0"
	   >>	foo
	   >> end
	   NameError: undefined local variable or method `foo' for #<Object:0x4013d0f0>
	   (irb):3
	   (irb_local_binding):1:in `eval'

Here-document
       Implementation of Here-document is incomplete.

Symbol
       Irb can not always recognize a symbol as to be Symbol. Concretely, an expression have completed, however  Irb  regard  it  as  continuation
       line.

								     May 2001							       irb-beta(1)
All times are GMT -4. The time now is 01:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy