New answers tagged

7

To select only the SSE flags, try: awk '/SSE/' ORS=' ' RS=' ' The key thing here is setting the record separators on input and output to a space. That way, each option is accepted or rejected separately. For example: $ SUNCC_CXXFLAGS="-D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AES__ -D__PCLMUL__ ..." $ newFLAGS="$(echo "$...


0

Use lxgrep from the ltXML2 toolkit (Edinburgh University), eg $ lxgrep -w A '(id|C|D)' test.xml <A> <id>123</id> <C>value1</C> <D>value2</D> </A> Using these kinds of tool is far faster and more reliable than rolling your own. XML FAQ: http://xml.silmaril.ie/


3

From the mv man page -t, --target-directory=DIRECTORY move all SOURCE arguments into DIRECTORY mv's default behavior is to move everything into the last argument so when xargs executes the command it does it like mv /destinationFolder pipedArgs without the -t it would try to move everything into the last arg piped to xargs. With the -t ...


0

Assuming you have perl installed (use which perl and if it is installed the output should look something like /usr/bin/perl), you can do a perl one-liner and adjust the regular expression to your liking. perl -p -i.bak -w -e 's/[a-z]//g' test.txt # strips lowercase or perl -p -i.bak -w -e 's/([a-z])/\U$1/g' test.txt # converts to uppercase ...


5

I'm not sure if you're trying to convert lower to upper or remove lower all together. Give this a shot for the lower to upper conversion. tr [:lower:] [:upper:] < ws2.txt To trim out lowercase chars you can use sed sed -e 's/[a-z]//g' ws2.txt Or you can use tr as suggested by @fd0 tr -d '[:lower:]' < ws2.txt To trim out numbers and capital ...



Top 50 recent answers are included