Hi All,
I want to create a command that executes a text editor with the most recent file in the current current directory.
So a good start to achieve this is :
ls -lrt | cut -c55- | tail -1
which provides the name of the most recent file in a directory
The problem is to pipe the... (4 Replies)
current dir :
/home/sales
ls -l
abc.txt 17th aug
bcd .txt 16t oct
-------
------
Total files : 100
if i want to move only those files dated 17 aug into another sub directory /home/sales/texas
how do i pipe the result of 'ls' command to a 'mv' command (1 Reply)
Hi My friends
I have used this command to find files are modified within the past 24 hours
and then many files are shown but I want transfer all these files to special directory by using pipe .
can any one tell me what is the next step ? (11 Replies)
i want to redirect output of one command as the command line argument of another script
for example, say i would run this command:
find . -xdev -type f -size +4096 -exec ls -al {} \;
i wan to be able to do something like:
echo +4096 | find . -xdev -type f -size ****** -exec... (3 Replies)
I am pretty new to UNIX. My client has a requirement where in a directory we have some files with somewhat similar name
like test_XX.txt, test_XY.txt, test_XZ.txt, test_ZZ.txt, test_ZY.txt, test_ZX.txt, test_YY.txt......Out of these files
few files have 0 bytes. Is there a way where we can go... (7 Replies)
Hi all,
Can someone help me with the following problem.
I am executing the following command:
(search for occurences of 'error' in files that match cl-*.log expression)
> grep -cw -i --max-count=1 'error' cl-*.log
this command outputs:
cl-apache.log:1
cl-apache_error.log:1... (3 Replies)
Trying to get the below command to work which it does, however each time, regardless of host being up or not it always loops back to the start of the function where I need it to stop if the host is up and continue with teh rest of teh function.
echo -ne "Remote/local host address. Example... (2 Replies)
Hi Team,
Need a help on how to pipe a command out put to a shell script. My shell script looks like below.
cat shell_script
#!/usr/bin/ksh
input =$@
echo " we are inside the shell script"
echo " here are the input parameters"
..........................
..................
... (11 Replies)
There is a text file in my project named as "mom.txt" in which i want to have contents like..................
LSCRM(Application Name):
1: This is my first application.
2: Today we did shell scripting automation for this app.
3: It was really a good fun in doing so.
4: Really good.| (Here i... (7 Replies)
Discussion started by: Abhijeet Anand
7 Replies
LEARN ABOUT OSX
irb
IRB(1) Ruby Programmers Reference Guide IRB(1)NAME
irb -- Interactive Ruby Shell
SYNOPSIS
irb [--version] [-dfm] [-I directory] [-r library] [--[no]inspect] [--[no]readline] [--prompt mode] [--prompt-mode mode] [--inf-ruby-mode]
[--simple-prompt] [--noprompt] [--tracer] [--back-trace-limit n] [--irb_debug n] [--] [program_file] [argument ...]
DESCRIPTION
irb is the REPL(read-eval-print loop) environment for Ruby programs.
OPTIONS --version Prints the version of irb.
-E external[:internal]
--encoding external[:internal]
Same as `ruby -E' . Specifies the default value(s) for external encodings and internal encoding. Values should be separated
with colon (:).
You can omit the one for internal encodings, then the value (Encoding.default_internal) will be nil.
-I path Same as `ruby -I' . Specifies $LOAD_PATH directory
-U Same as `ruby -U' . Sets the default value for internal encodings (Encoding.default_internal) to UTF-8.
-d Same as `ruby -d' . Sets $DEBUG to true.
-f Suppresses read of ~/.irbrc.
-h
--help Prints a summary of the options.
-m Bc mode (load mathn, fraction or matrix are available)
-r library Same as `ruby -r'. Causes irb to load the library using require.
--inspect Uses `inspect' for output (default except for bc mode)
--noinspect Doesn't use inspect for output
--readline Uses Readline extension module.
--noreadline Doesn't use Readline extension module.
--prompt mode
--prompt-mode mode
Switch prompt mode. Pre-defined prompt modes are `default', `simple', `xmp' and `inf-ruby'.
--inf-ruby-mode
Uses prompt appropriate for inf-ruby-mode on emacs. Suppresses --readline.
--simple-prompt
Makes prompts simple.
--noprompt No prompt mode.
--tracer Displays trace for each execution of commands.
--back-trace-limit n
Displays backtrace top n and tail n. The default value is 16.
--irb_debug n Sets internal debug level to n (not for popular use)
ENVIRONMENT
IRBRC
Also irb depends on same variables as ruby(1).
FILES
~/.irbrc Personal irb initialization.
EXAMPLES
% irb
irb(main):001:0> 1 + 1
2
irb(main):002:0> def t(x)
irb(main):003:1> x+1
irb(main):004:1> end
=> nil
irb(main):005:0> t(3)
=> 4
irb(main):006:0> if t(3) == 4
irb(main):007:1> p :ok
irb(main):008:1> end
:ok
=> :ok
irb(main):009:0> quit
%
SEE ALSO ruby(1).
REPORTING BUGS
Security vulnerabilities should be reported via an email to <security@ruby-lang.org>. Reported problems will be published after being fixed.
And you can report other bugs and feature requests via the Ruby Issue Tracking System (http://bugs.ruby-lang.org). Do not report security
vulnerabilities via the system because it publishes the vulnerabilities immediately.
AUTHORS
Written by Keiju ISHITSUKA.
UNIX November 7, 2012 UNIX