|
odd egrep behavior
|
| |
I am trying to extract a string from the output of a DICOM directory
parser. The string I'm trying to match looks similar to this:
(0004,1500) CS #36 [DICOM\ST000000\SE000000\CR000 000.DCM] Referenced File
ID
"s" is a much larger string in which the target string is embedded.
From the console, this string matches:... more »
|
|
awk printf inside xargs
|
| |
hi i'm trying to run multi-core bash script with xargs with an awk command inside.
for dir in UA_tile_txt $(for n in `seq 1 41` 50 ; do echo UA_buf$n"_tile_txt" ; done ) ; do echo $dir ; done | xargs -n 1 -P 16 bash -c $'
dir="$1"
IN_UA=/weldgfs/p51/gius_urban/ pop_urban/buffer_tif... more »
|
|
combine xargs and eof
|
| |
Hi
i'm using often xargs to run process in parallel
ls *.txt | xargs -n 1 -P 10 bash myscript.sh
where myscript.sh is (for examples of course is longer):
echo $1
i would like to perform the same operation using the EOF syntax and import the arguments inside the eof
I tried
ls *.txt | xargs -n 1 -P 10 <<... more »
|
|
NL in Heredoc
|
| |
Is there a way to expand new lines in heredocs?
In the script below "echo $all" prints:
put File1
put File2
...
however $all in the heredoc DATA expands to
put FILE1\nput FILE2\nput ...
...
FILE_LIST="
File1
File2
File3
File4
File5
"
nl="\n"
for each in $FILE_LIST
do
all=$all"put "$each${nl}... more »
|
|
time zone 1 hr east of
|
| |
For a script I need to create file names with date embedded in them,
and since a lot of the files arrive (the box is in CDT) after midnight
EDT
but just prior to it in CDT, I issue this at the top of the script:
export TZ=America/New_York
... and get file names created for what (to CDT) would be the next... more »
|
|
How can I set up an alias, function or variable as a shortcut to "2>&1 | tee build.log"?
|
| |
As the subject line says, I'd like a quicker way to type "2>&1 | tee build.log"
Or even better, I'd like a shortcut which did expanded to 2>&1 | tee $1.$2.log" where $1 and $2 are taken from the current line.
I've tried a few different things and here are the problems I found
1. Aliases seem to apply to first words (or first word after another alias) only. So I'm pretty sure they can't help.... more »
|
|
bash shell script question (what's wrong in this script?)
|
| |
This is a script I wrote in Oracle Enterprise Linux 5.
This script yields the errors that follow:
...CWD=/directory
cd $CWD
for filename in `ls *.zip` do
s=$(ls -lah $filename | awk '{ print $5}');
if [ $s -eq 0 ] ; then
echo "File $filename has zero file size in $CWD" | mailx -s " ERROR:... more »
|
|
Argument "-o nospace" of compgen isn't work?
|
| |
Is argument "-o nospace" of compgen not work?
I write a simple script for auto-completion as following,
-------------
_cooltool()
{
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -o nospace -W "fooOption barOption" -- $cur) )... more »
|
|
|