Created
August 26, 2012 08:13
-
-
Save coop/3476099 to your computer and use it in GitHub Desktop.
This file contains 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 | |
if ARGV.first | |
File.open(ARGV.first, 'r') do |file| | |
counter = 0 | |
file.each_line { |line| counter += 1 } | |
puts "#{counter} lines" | |
end | |
else | |
puts "Pass the path to the file you want to read" | |
end |
This file contains 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 | |
print "Enter the size: " | |
number = gets.chomp | |
number.to_i.times { |n| print '#' } | |
puts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment