Skip to content

Instantly share code, notes, and snippets.

@fourdollars
Last active November 23, 2016 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fourdollars/aa8527f976543bc06211e866f4a388db to your computer and use it in GitHub Desktop.
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
#! /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