Welcome to LinuxQuestions.
Code:
open my $in, '<', /etc/ssh/sshd_config or die "Can't read old file: $!";
open my $out, '>', /etc/ssh/sshd_config or die "Can't write new file: $!";
Looks like your trying to convert perl to bash. In addition, that
Code:
while ( <$in> )
in perl is something like
while ( my $valuename = <$in> )
However, none of the above statements will work in bash (as far as I know...) A simple loop to read a file
Code:
file="myfile"
while read line
do
# display $line or do somthing with $line
echo "$line"
done <"$file"