Last active
November 23, 2016 12:42
-
-
Save fourdollars/aa8527f976543bc06211e866f4a388db to your computer and use it in GitHub Desktop.
Print numbers in sequence without repeated digits. https://www.ptt.cc/bbs/Programming/M.1479904715.A.DD6.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
read -p 'Enter a number : ' num | |
seq $((10**num)) | egrep -v "([0-9]).*\1" | xargs echo | sed 's/ /, /g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment