Skip to main content
deleted 15 characters in body
Source Link
Kevin
  • 3.1k
  • 1
  • 15
  • 21

Bash

#!/bin/bash
taceval `tac $0 | head -n 4 | xargs -i sh -c 4` "eval&& {}"
exit
echo 'Line1' ;
echo 'Line2' ;
echo 'Line3' ;
echo 'Line4' ;

Output:

Line4
Line3
Line2
Line1

Bash

#!/bin/bash
tac $0 | head -n 4 | xargs -i sh -c  "eval {}"
exit
echo 'Line1'
echo 'Line2'
echo 'Line3'
echo 'Line4'

Output:

Line4
Line3
Line2
Line1

Bash

#!/bin/bash
eval `tac $0 | head -n 4` && exit
echo 'Line1' ;
echo 'Line2' ;
echo 'Line3' ;
echo 'Line4' ;

Output:

Line4
Line3
Line2
Line1
deleted 80 characters in body
Source Link
Kevin
  • 3.1k
  • 1
  • 15
  • 21

Bash

The first line of this program causes it to run the last four lines backwards:

#!/bin/bash
tac $0 | head -n 4 | xargs -i sh -c  "eval {}"
exit
echo 'Line1'
echo 'Line2'
echo 'Line3'
echo 'Line4'

Output:

Line4
Line3
Line2
Line1

Bash

The first line of this program causes it to run the last four lines backwards:

#!/bin/bash
tac $0 | head -n 4 | xargs -i sh -c  "eval {}"
exit
echo 'Line1'
echo 'Line2'
echo 'Line3'
echo 'Line4'

Output:

Line4
Line3
Line2
Line1

Bash

#!/bin/bash
tac $0 | head -n 4 | xargs -i sh -c  "eval {}"
exit
echo 'Line1'
echo 'Line2'
echo 'Line3'
echo 'Line4'

Output:

Line4
Line3
Line2
Line1
added 92 characters in body
Source Link
Kevin
  • 3.1k
  • 1
  • 15
  • 21

Bash

The first line of this program causes it to run the last four lines backwards:

#!/bin/bash
tac $0 | head -n 4 | xargs -i sh -c  "eval {}" 2>/dev/null
exit
echo 'Line1'
echo 'Line2'
echo 'Line3'
echo 'Line4'

Output:

Line4
Line3
Line2
Line1

Bash

#!/bin/bash
tac $0 | xargs -i sh -c  "eval {}" 2>/dev/null
exit
echo 'Line1'
echo 'Line2'
echo 'Line3'
echo 'Line4'

Output:

Line4
Line3
Line2
Line1

Bash

The first line of this program causes it to run the last four lines backwards:

#!/bin/bash
tac $0 | head -n 4 | xargs -i sh -c  "eval {}"
exit
echo 'Line1'
echo 'Line2'
echo 'Line3'
echo 'Line4'

Output:

Line4
Line3
Line2
Line1
Source Link
Kevin
  • 3.1k
  • 1
  • 15
  • 21
Loading