Skip to content

Tag: gnu

Comments in sed command file

Can I put comments (or something functionally equivalent) into a sed command file? subs.sed Answer Yes, comments can be added to a sed file using #. From the manual page of sed: Command Synopsis … The comment extends until the next newline (or the end of a -e script fragment).

What is the point of “grep -q”

I was reading the grep man page and came across the -q option, which tells grep to “not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected.” I don’t understand why this could be desirable or useful behavior. In a program who’s reason d’etre seems to be read

Replace characters on specific location every line

We got an exercise where we have to do certain things with the following text document: It’s all data seperated by a “|”. For this exercise, if the year of the first ascent is empty, I need to replace the “||” with “|unclimbed|” I can’t do it like this: Because that would replace other empty fields. So my question is,

configure: error: no acceptable C compiler found in $PATH

I am trying to Build and Install the Apache Thrift compiler and libraries I had to type this command is shown in instructions ./configure && make But I get this error: When I type in my command prompt gcc –version I get this gcc (GCC) 5.3.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source

Attach to a GNU screen and then execute commands

I have seen some similar questions asked but the solutions don’t seem to work in my case. I am trying to SSH into a specific screen instance on a Node machine and then execute some commands My current process is this: On the remote machine I create a screen instance: screen -dmS “my_screen” From my local machine I do something

Gnu sort: stray characters in field specification

sort doesn’t seem to like my key specification. Why? From the man page: -k, –key=KEYDEF : sort via a key; KEYDEF gives location and type KEYDEF is F[.C][OPTS][,F[.C][OPTS]] for start and stop position, where F is a field number and C a character position in the field; both are origin 1, and the stop position defaults to the line’s end.