#line <lineNr> "<filename>"
1
2
3
4
5
6
7
8
9
#!/bin/bash
perl -e 'prnt "Hallo\n"'
if [ $? -ne 0 ]; then
ln="$LINENO"
let "ln -= 3"
echo -e "\nSomething went wrong in Perl-command, line $ln.\n"
fi
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
echo Line3
perlscript='
use strict;
my $x;
$y = 1;
my $z = 1;
'
perl -E "$perlscript"
1 2 3 4 5 6 7
#!/bin/bash local perl_updater=$(cat <<'EOF' ... EOF ) perl -E "$perl_updater" $DBFILE $UPDFILE $2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#!/bin/bash echo "in bash line(3) $LINENO" LINE=$((LINENO + 6)) Fshell () { echo in func perler=$(cat <<'EOF' say "in perl line ", __LINE__; #### hier: #line ($ARGV[0] + __LINE__ + 1) !?? ####line 15 say "in perl line ", __LINE__; say "ARGV: $ARGV[0] line: ", __LINE__, " ARGV+line: ", $ARGV[0] + __LINE__; say "in perl line ", __LINE__; EOF ) echo "in bash line(22): $LINENO" perl -E "$perler" $LINE }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#!/bin/bash echo "in bash line(3) $LINENO" LINE=$((LINENO + 6)) Fshell () { echo in func perler=$(cat <<'EOF' say "in perl line ", __LINE__; #### hier: #line ($ARGV[0] + __LINE__ + 1) !?? #line 15 say "in perl line ", __LINE__; say "ARGV: $ARGV[0] line: ", __LINE__, " ARGV+line: ", $ARGV[0] + __LINE__; say "in perl line ", __LINE__; EOF ) echo "in bash line(22): $LINENO" perl -E "$perler" $LINE }
1 2 3 4 5 6 7 8 9
suse 5.010; say 4711; die if $ARGV[0] !~ /^\d+$/; eval qq(#line $ARGV[0] !??.pl warn 'ooohhh noooo!';); say "42 is a lonely number";