atext: apply some operations to the input files (names from the stdin) usage: atext [parameters] parameters: -ins {place} {text}: insert text, place can be 'begin','end' or a line number (negative numbers count backward from the end of the file). place can be defined with line contents, too: contains:{text}, equals:{text} - here the each line that fulfills the condition will be selected as insertion point text can select files, too: file:{filename} - here contents of the given file will be inserted several insertion can be specified at the same time, eacf of the will be applied to the input files -a[fter]: the insertion will take place after the insertion position (default: before) -rp {text1 text2}: replace each occurence of text1 with text2 -rpv {varname} {value}: replace the '$(varname)' texts with value -rtv: replace vars with current time (YEAR, MON, DAY, HOUR, MIN, SEC) -erp {search_expr} {val_expr}: if the search_expr evaluates to true, the current line is replaced by the value of val_expr (the runtime variable is 'line'). -del {line}: delete the given line(s), exmaple: '10,20-25' or 'contains:foo' or 'begin' or 'end' -ed[el] {expr}: delete lines where the given expression evaluates to a nonzero value with the current line (the variable name is 'line'). -rm {text}: each occurence of the text will be removed -fw: forward the names of the processed files to the output -sp: forwarded file name separator is space (instead of newline) any other parameter is treated as an input file -rtws: remove trailing white spaces. The spaces and tabs will be removed from the end of the lines. -rtabs {padder} {tabsize}: replace tabs with the padder and tab size. The tabs are interpreted so that they always align the text to the next tab-sized position. Examples: afind "*.txt" | atext -ins begin "Monty Python" -> the text will be inserted as the first line afind "*.txt" | atext -ins end file:sign.txt -> the contents of sign.txt will be inserted at the end of the files afind "*.txt" | atext -rp "Carl Palmer" "Cozy Powell" -> the text files will contain the 1985 ELP crew afind "*.txt" | atext -rpv AUTHOR "Attila NAGY" -> each occurence of '$(AUTHOR)' will be replaced with the writer's name afind "*.txt" | atext -rtv -> the '$(YEAR)', '$(MON)', '$(DAY)', '$(HOUR)', '$(MIN)', '$(SEC)' occurences will be replaced with the current time afind "*.txt" | atext -del contains:Trotsky -> Stalin can (could have) remove(d) each reference to his opponent afind "*.txt" | atext -ins contains:apple 'A fruit in the prev line' -a -> each line that contains the 'apple' text will be followed by the text atext fruits.txt -erp "line []= 'apple'" "line + ' -> ' + str_upper(line)" -> the lines containing 'apple' will be trandformed to the concatenation of the original value, a horizontal arrow and the uppercase version of the line. atext my_novel.txt -ed "line []= 'rem' || line []= '********'" -> delete lines from the file that contain a rem(ark) or a bunch of asterisks