Skip to content

Instantly share code, notes, and snippets.

@stevebrun
Created October 5, 2013 06:50
Show Gist options
  • Save stevebrun/6837567 to your computer and use it in GitHub Desktop.
Save stevebrun/6837567 to your computer and use it in GitHub Desktop.
A quick script to take a file in from stdin and write it to stdout, replacing all tabs with four spaces.
#! /usr/bin/env ruby
# take standard in text and replace all the tab instanes with four spaces
# print the resulting test to standard out
line = ""
while (line = gets) != nil do
line.gsub! "\t", " "
puts line
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment