Created
May 24, 2012 17:41
-
-
Save jesusangelm/2783008 to your computer and use it in GitHub Desktop.
simple script de prueba que lee el archivo de texto que se le pase como argumento.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| def leer archivo | |
| File.foreach(archivo).with_index do |linea, indice | | |
| puts "#{indice}: #{linea}" | |
| end | |
| end | |
| if ARGV.size > 1 | |
| puts "Este script solo admite un argumento!" | |
| else | |
| leer ARGV[0] | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment