Explore >> Select a destination


You are here

kaveh.page
| | blog.nuculabs.de
9.3 parsecs away

Travel
| | Hello, This challenge is not that hard but it's quite confusing. To solve this challenge very quickly all you have to do is patch it in 2 places and then run it with different arguments until the flags get's spiten out. Here's a sample script that runs the binary 100 times with arguments from 1 to 100 [code language="bash"] printf 'start\n' for i in {1..100} do printf "$i " ./program "$i" | xxd -r -p printf '\n' done printf '\nend\n' [/code]
| | lanziani.com
15.4 parsecs away

Travel
| | I do a big use of shell scripts, and many of them contain a for loop, do you know what normally happen when you press CTRL^C and the script is executing an action inside the loop?
| | willhaley.com
6.9 parsecs away

Travel
| | This is a trivial example, but is meant to demonstrate how you can pipe arguments to a bash function. #!/usr/bin/env bash lowercase() { # Grab input. declare input=${1:-$(</dev/stdin)}; # Use that input to do anything. echo "$input" | tr '[:upper:]' '[:lower:]' } echo "HELLO there, FRIEND!" | lowercase Which outputs the following. hello there, friend!
| | www.tvagile.com
36.9 parsecs away

Travel
|