Download The unix programming environment

Transcript
166
The unix programming environment
# Bourne shell
if [ $x -eq $y ]; then
fi
# Perl
if ( $x == $y )
{
}
/* C */
if ( x == y )
{
}
String comparison
# C shell
if ( $x == $y ) then
endif
# Bourne shell
if [ $x = $y ]; then
fi
# Perl
if ( $x eq $y ) then
{
}
/* C */
if (strcmp(x,y) == 0)
{
}
Opening a le
# C shell, Bourne shell - cannot be done (pipes only)
# Perl
open (READ_HANDLE,"filename");