Last active
April 5, 2017 15:11
-
-
Save gdelpierre/fe79913075e35e4b1688d3d6fd43a317 to your computer and use it in GitHub Desktop.
80 colonnes on a dit
This file contains hidden or 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
#include <stdio.h> | |
int maxline=80; | |
int main(int argc, char* argv[]) | |
{ | |
char line[2048]; | |
if( (argc>1) && (atoi(argv[1])>0) ) maxline=atoi(argv[1]); | |
while(fgets(line,sizeof(line),stdin)) { | |
line[maxline]='\0'; printf("%s\n",line); | |
} | |
} |
awk '{ print substr($0, 0, 81) }'
sed 's/^\(................................................................................\).*/\1/'
sed "s/^\($(perl -e "print '.' x 80")\).*/\1/"
fold -w 80
cut -c 1-80```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@outini il dit
sed 's/^\(.\{80\}\).*/\1/'