Search Results

Search: Posts Made By: inotech
2,522
Posted By inotech
diff <file1> <file2> &>/dev/null && echo 0 ||...
diff <file1> <file2> &>/dev/null && echo 0 || echo 1
[ "$(md5sum <file1> 2>/dev/null | cut -d' ' -f1)" == "$(md5sum <file2> 2>/dev/null | cut -d' ' -f1)" ] && echo 0 || echo 1
1,678
Posted By inotech
may be: echo -e $VAR | cut -d ' ' -f 1
may be:

echo -e $VAR | cut -d ' ' -f 1
3,168
Posted By inotech
Thanks! #!/usr/bin/perl $/=undef; ...
Thanks!

#!/usr/bin/perl

$/=undef;
open(FH,a);
$string=<FH>;
while($string =~ s/(N(\s+.+)\s+( &.*\n)+)//m)
{
print split(/\n/,$1)."\n";
}
3,168
Posted By inotech
New trouble. As prev. file data.dat: N...
New trouble. As prev.

file data.dat:

N xxx xxx 353
& xxx 99 012
& xxxx 99 000
09203809 290188309
9210830 0293801
B <some digits>
& <some digits>
& <some...
2,120
Posted By inotech
if you want use xargs find / -name XYZ -type f...
if you want use xargs
find / -name XYZ -type f | xargs -iINCLUDE ls -l INCLUDE

or

find / -name XYZ -type f -exec ls -l {} \;
4,012
Posted By inotech
date
DAYZ=36; for num in $(seq 0 ${DAYZ}); do date -d "-${num} day" +"%Y-%m-%d" ; done
3,168
Posted By inotech
Thnx
Thanks
5,336
Posted By inotech
A:
echo -e {1..100}"\n" | xargs -n 1 -P 10 script.sh

in script.sh:
<insert file to db> $1.ext ...

split 1 000 000 records to files with names 1 to 100 (*.ext)

**one of the many ways
5,336
Posted By inotech
xargs
HINT:
use xargs -n <XXX> -P <XXX> for multithreading
32,110
Posted By inotech
to pravin27 ... bash #!/bin/bash ls -latr...
to pravin27 ... bash
#!/bin/bash

ls -latr | awk '{printf ("%-20s %s %-20s \n",$9,$1,$5)}' | while read line
do
file_type=$(echo $line | awk '{print($2)}' | cut -c1)
[ -z "$file_type" ]...
3,168
Posted By inotech
bingo in shell
<some command> | egrep -v "^\-+$" | while read LINE; do
[[ ${LINE} =~ "^revision[0-9]+" ]] && { L_BRIEF="1"; L_REF=${LINE%%|*}; }
if [[ ${LINE} =~ "^Brief: " ]]; then
echo -e...
3,168
Posted By inotech
How extract strings (perl)
Sample data:

revision001 | some text | some text
Comment: some comment
Brief: 1) brief
2) brief
------------------------------------------
revision002 | some text | some text...
16,311
Posted By inotech
-R - warn use
this argument (-R) apply 777 to all (files and folders)
Showing results 1 to 13 of 13

 
All times are GMT -4. The time now is 11:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy