Tag Info

New answers tagged

2

How about perl? perl -pe 's/^(.+?)(?=;)/$1 . " "x(41-length($1))/e' file LDX LEVEL LDA INITD015,X ; INITIAL ACTIVE SPRITES STA $D015 STA SAVED015 LDA INITXPOS,X ; INITIAL HERO X COORDINATE STA XPOS LDA INITYPOS,X ; INITIAL HERO Y COORDINATE STA YPOS LDA ...


0

awk '/^Taxonomy:/{t=FILENAME; sub(/^.*\?ID=/, x, t); $1=t; print; close(FILENAME)}' /files/location/* > output.txt


2

When dealing with multiple files, grep prints each filename before the matches. Since you don't need to search for a regular expression, you can use the -F option to search for a fixed string (which will speed things up a bit); the -r option tells grep to act recursively. The -r option is from GNU's version of grep, so it won't work on systems with other ...


2

Instead of copying what is displayed on the terminal (only what fits on the screen, with), copy the actual text. Use one of the external utilities xsel or xclip (they have mostly the same features, I'll use xsel in this answer) to copy data from or to the X clipboard. To copy to the clipboard, pass the desired content on standard input. When pasting from the ...


3

For said purpose - that is stopping the script at any given line - you could simply use exit to break at this point. For any real life application this would seem a little crude though but for learning purposes it should fit. Say: #!/bin/sh # now I am working here do_something exit # this is old, do not execute did_something exit # this is even older, ...



Top 50 recent answers are included