Skip to main content
Commonmark migration
Source Link

##bash 111

bash 111

#!/bin/bash
s=$1
l=${#s}
for i in $(seq 1 $((l-2)))
do
test "${s:i:$(((l-i)/2))}" = "${s:$(((l+i)/2))}"&&exit 0
done||false

111 chars without shebang. Invocation:

./tailrepeated.sh foobalaa && echo "true" || echo "false"

##bash 111

#!/bin/bash
s=$1
l=${#s}
for i in $(seq 1 $((l-2)))
do
test "${s:i:$(((l-i)/2))}" = "${s:$(((l+i)/2))}"&&exit 0
done||false

111 chars without shebang. Invocation:

./tailrepeated.sh foobalaa && echo "true" || echo "false"

bash 111

#!/bin/bash
s=$1
l=${#s}
for i in $(seq 1 $((l-2)))
do
test "${s:i:$(((l-i)/2))}" = "${s:$(((l+i)/2))}"&&exit 0
done||false

111 chars without shebang. Invocation:

./tailrepeated.sh foobalaa && echo "true" || echo "false"
Source Link
user unknown
  • 4.6k
  • 31
  • 31

##bash 111

#!/bin/bash
s=$1
l=${#s}
for i in $(seq 1 $((l-2)))
do
test "${s:i:$(((l-i)/2))}" = "${s:$(((l+i)/2))}"&&exit 0
done||false

111 chars without shebang. Invocation:

./tailrepeated.sh foobalaa && echo "true" || echo "false"