Running the Ruby Interpreter : Ruby Commandline « Language Basics « Ruby

Ruby
1. ActiveRecord
2. Array
3. CGI
4. Class
5. Collections
6. Database
7. Date
8. Design Patterns
9. Development
10. File Directory
11. GUI
12. Hash
13. Language Basics
14. Method
15. Network
16. Number
17. Rails
18. Range
19. Reflection
20. Statement
21. String
22. Threads
23. Time
24. Tk
25. Unit Test
26. Windows Platform
27. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Ruby » Language Basics » Ruby Commandline 
Running the Ruby Interpreter


Usage:

ruby [switches] [--] [program filename] [arguments]


Switches (or command-line options):


-0octal]      Specify a record separator (\if no argument).

-a              Autosplit mode with -n or -p (splits $_ into $F).

-c              Check syntax only.

-C directory    cd to directory before executing your script or program.

-d              Set debugging flags (set predefined variable $DEBUG to true).

-e ' command'   Execute one line of script. Several -es allowed. Omit [program filename].

-F pattern      split( ) pattern for autosplit (-a).

-iextension]  Edit ARGV files in place (make backup if extension supplied).

-I directory    Specify $LOAD_PATH (predefined variabledirectory; may be used more than once.

-K kcode        Specify the character set. See Table 16.

-l              Enable line-ending processing.

-n              Assume 'while gets( ); ... end' loop around your script.

-p              Assume loop like -n but print line also like sed.

-r library      Require the library before executing your script.

-s              Enable some switch parsing for switches after script name.

-S              Look for the script using PATH environment variable.

-Tlevel]      Turn on tainting checks.

-v              Print version number, then turn on verbose mode (compare --version).

-w              Turn warnings on for your script or program.

-Wlevel]      Set warning level: 0=silence, 1=medium, and 2=verbose (default).

-xdirectory]  Strip off text before #! shebang line, and optionally cd to directory.

--copyright     Print the copyright.

--version       Print the version (compare -v).

 
Related examples in the same category
1. type a command to check the version of Ruby (this works on Unix/Linux and Windows):
2. create a basic Ruby script called debugtest.rb:
www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.