Skip to content

Instantly share code, notes, and snippets.

@rcanepa
Created August 19, 2016 20:37
Show Gist options
  • Save rcanepa/dff4855fbfa18e2c6db2bbbce0b6539b to your computer and use it in GitHub Desktop.
Save rcanepa/dff4855fbfa18e2c6db2bbbce0b6539b to your computer and use it in GitHub Desktop.
UNIX jot
$ jot - 1 5
^
return numbers from 1 to 5
1
2
3
4
5
$ jot -b "#" - 1 5
^ ^
return # from line 1 to 5
#
#
#
#
#
$ jot -b "#" - 1 5 | xargs
^
lines to arguments
# # # # #
$ jot -b "#" - 1 5 | xargs | sed 's/ //g'
#####
$ jot - 1 20 | while read n; do jot -b "#" - 1 $n | xargs | sed 's/ //g'; done
#
##
###
####
#####
######
#######
########
#########
##########
###########
############
#############
##############
###############
################
#################
##################
###################
####################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment