gnu

How to configure 'less' to show formatted markdown files?

試著忘記壹切 提交于 2021-02-17 21:38:44
问题 I would like to have less display *.md markdown files with some formatting -- like I know less can, for manpages, etc. I am running Ubuntu 12.04. I am as far as putting a user defined filter into .lessfilter : #!/bin/sh case "$1" in *.md) fn=/tmp/$1.$$.html markdown "$1" | html2txt > $fn ### LOSES FORMATTING cat $fn ### TO STDOUT??? ;; *) # We don't handle this format exit 1 esac # No further processing by lesspipe necessary exit 0 So, the main questions are: How can I pass some basic

How to configure 'less' to show formatted markdown files?

廉价感情. 提交于 2021-02-17 21:37:46
问题 I would like to have less display *.md markdown files with some formatting -- like I know less can, for manpages, etc. I am running Ubuntu 12.04. I am as far as putting a user defined filter into .lessfilter : #!/bin/sh case "$1" in *.md) fn=/tmp/$1.$$.html markdown "$1" | html2txt > $fn ### LOSES FORMATTING cat $fn ### TO STDOUT??? ;; *) # We don't handle this format exit 1 esac # No further processing by lesspipe necessary exit 0 So, the main questions are: How can I pass some basic

Make Executable Binary File From Elf Using GNU objcopy

别说谁变了你拦得住时间么 提交于 2021-02-17 20:57:08
问题 I'd like to copy an executable ELF file via: $ objcopy -O binary myfile.elf myfile.bin Unfortunately: $ chmod +x myfile.bin $ ./myfile.bin results in: cannot execute binary file Is there any way to retain the files executability? 回答1: To be executable by the execve(2) syscall, a file usually has to be some elf(5) file (or some script, or some old a.out format). But see also binfmt_misc Your objcopy(1) command is loosing the essential meta-data in the ELF file. Maybe you want strip(1) Recall

Old fortran code and getting an OPEN statement error using GNU

五迷三道 提交于 2021-02-13 17:30:31
问题 I'm trying to compile a very old code but I get this error while compiling the code Error: Syntax error in OPEN statement at (1) The code: WRITE(LUTTO,'('' TYPE NAME OF FILE CONTAINING INPUT : '',$)') C READ (LUTTI,'(Q,A)') NCHAR,FILNAM READ (LUTTI,'(A)') FILNAM NCHAR = len_trim(FILNAM) C ----- OPEN DATA FILE ----- print *, "NCHAR" OPEN( UNIT = LUINP, NAME = FILNAM(1:NCHAR), $ STATUS = 'OLD', RECL = 80 , $ CARRIAGECONTROL= 'LIST', ERR = 9900 ) 回答1: name=... in the open statement is invalid

GNU Readline (libreadline): Displaying output message asynchronously

99封情书 提交于 2021-02-08 06:32:13
问题 While using readline (blocking) for user input, I would like to output lines of text to the console asynchronously from another thread. Further, I would like that the readline prompt and current partial input line be removed from the console, the output line written, then the readline prompt and the partial user line restored - so as to give the appearance that the output was written "above" the prompt. By what combination of readline redisplay functions (or otherwise) can this be achieved?

What's the “correct” way to determine target and architecture for GNU binutils?

拟墨画扇 提交于 2021-02-07 20:52:23
问题 In my build chain, I need to do this: objcopy -I binary -O $BFDNAME -B $BFDARCH <this> <that> in order to get a binary file into library form. Because I want other people to be able to use this, I need to know how to get $BFDNAME and $BFDARCH from their toolchain when they run the build. I can get the values locally by running objdump -f against a file I've already built, but is there a better way which won't leave me compiling throw-away files just to get configuration values? 回答1: Thank you

How do strongly typed regexp constants work in GNU Awk?

随声附和 提交于 2021-02-07 17:31:21
问题 Strongly typed regexp constants is a handy tool that GNU Awk has. It is documented in GNU Awk User's Guide -> 6.1.2.2 Strongly Typed Regexp Constants and in there you can find interesting examples. From reading it, and comments to an answer I made up some examples that show those: $ cat file he;llo ho are you; $ gawk -v patt='@/;/' '$0 ~ patt' file # it prints those lines containing ";" he;llo you; In this case, we pass the pattern ";" with @/;/ and so it prints all the lines that contain ";"

How do strongly typed regexp constants work in GNU Awk?

心已入冬 提交于 2021-02-07 17:29:22
问题 Strongly typed regexp constants is a handy tool that GNU Awk has. It is documented in GNU Awk User's Guide -> 6.1.2.2 Strongly Typed Regexp Constants and in there you can find interesting examples. From reading it, and comments to an answer I made up some examples that show those: $ cat file he;llo ho are you; $ gawk -v patt='@/;/' '$0 ~ patt' file # it prints those lines containing ";" he;llo you; In this case, we pass the pattern ";" with @/;/ and so it prints all the lines that contain ";"

How do strongly typed regexp constants work in GNU Awk?

一曲冷凌霜 提交于 2021-02-07 17:28:18
问题 Strongly typed regexp constants is a handy tool that GNU Awk has. It is documented in GNU Awk User's Guide -> 6.1.2.2 Strongly Typed Regexp Constants and in there you can find interesting examples. From reading it, and comments to an answer I made up some examples that show those: $ cat file he;llo ho are you; $ gawk -v patt='@/;/' '$0 ~ patt' file # it prints those lines containing ";" he;llo you; In this case, we pass the pattern ";" with @/;/ and so it prints all the lines that contain ";"

How to check the type of an awk variable?

一世执手 提交于 2021-02-07 04:20:10
问题 The Beta release of gawk 4.2.0, available in http://www.skeeve.com/gawk/gawk-4.1.65.tar.gz is a major release, with many significant new features . I previously asked about What is the behaviour of FS = " " in GNU Awk 4.2?, and now I noticed the brand new typeof() function to deprecate isarray(): Changes from 4.1.4 to 4.2.0 The new typeof() function can be used to indicate if a variable or array element is an array, regexp, string or number. The isarray() function is deprecated in favor of