perl -pe 's/^\[//; s/\]$//' < hall #### while (<>) { #### print; } #### #!/path/to/perl # (usually, on *nix, the path is /usr/bin/perl) while (<>) { s/^\[//; # note that the "[" and s/\]$//; # the "]" need to be preceded by backslash print; } #### while (<>) { chomp; print substr( $_, 1, length() - 2 ), $/; }