Unix/Linux Go Back    

Showing results 1 to 25 of 64
Search took 0.01 seconds.
Search: Posts Made By: ichigo
Forum: Shell Programming and Scripting Linux 12-19-2009
Replies: 7
Views: 2,115
Posted By ichigo
for file in /path/dir/* do lsof | grep...

for file in /path/dir/*
do
lsof | grep "$file"
if [ $? -eq 1 ];then
echo "$file safe to remove"
if
done
Forum: Shell Programming and Scripting Linux 12-19-2009
Replies: 7
Views: 36,997
Posted By ichigo
diff directory1 directory2

diff directory1 directory2
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 19
Views: 7,052
Posted By ichigo
gawk ' { o=$1; $1="" ...

gawk '
{
o=$1; $1=""
a[o]=a[o]"\t"$0
}END{ for (i in a) print i,a[i] } ' file*
Forum: UNIX for Dummies Questions & Answers Linux 12-18-2009
Replies: 2
Views: 1,534
Posted By ichigo
#!/bin/bash old=$1 new=$2 filename=$3 ...

#!/bin/bash
old=$1
new=$2
filename=$3
gawk -v o="$old" -v n="$new" '{ gsub(o,n) ;print}' $filename > newfile
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 5
Views: 1,426
Posted By ichigo
gawk '!/PRINTF/{ gsub("mid","MID") ...

gawk '!/PRINTF/{
gsub("mid","MID")
if($0~/IF/){
flag=1
print
next
}
print
}
flag{ print "{" ;flag=0} ' file
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 19
Views: 7,052
Posted By ichigo
gawk 'BEGIN{ for(i=1;i<=ARGC;i++){ ...

gawk 'BEGIN{
for(i=1;i<=ARGC;i++){
printf "%s\t", ARGV[i]
}
}
FNR==1{print ""}
{
gsub(/\r\n/,"")
printf "%s\t%s " ,$1,$2
}' file*
Forum: UNIX for Dummies Questions & Answers Linux 12-18-2009
Replies: 5
Views: 2,313
Posted By ichigo
gawk 'FNR==NR{ s[++d]=$0;next} /pqr/{ ...

gawk 'FNR==NR{ s[++d]=$0;next}
/pqr/{
print
for(i=1;i<=d;i++){ print s[i] }
next
}{print}
' file1 file2
Forum: UNIX for Advanced & Expert Users Linux 12-18-2009
Replies: 3
Views: 1,476
Posted By ichigo
gawk '/<A HREF=/ { o=$0 gsub(/<A...

gawk '/<A HREF=/ {
o=$0
gsub(/<A HREF=\042|\042>.*/,"",o)
link=o
gsub(/> <\/A>/,">"link"</A>")
print
}' file
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 6
Views: 10,787
Posted By ichigo
gawk '{ a[$2]=a[$2]+$3 }END{ #...

gawk '{
a[$2]=a[$2]+$3
}END{
# for(i in a) print i,a[i] | "sort"
b=asorti(a,c)
for(o=1;o<=b;o++){
print c[o],a[c[o]]
}
}' file
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 1
Views: 3,515
Posted By ichigo
wget http://somepage | grep <search term>

wget http://somepage | grep <search term>
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 4
Views: 4,427
Posted By ichigo
gnu_find /path -type f -printf "%s|%p\n"|sort...

gnu_find /path -type f -printf "%s|%p\n"|sort -n|tail -5
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 15
Views: 6,713
Posted By ichigo
$ num=3 $ gawk -v n=$num 'NR==n{print;exit}'...

$ num=3
$ gawk -v n=$num 'NR==n{print;exit}' file
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 11
Views: 2,309
Posted By ichigo
awk -F"|" 'BEGIN{ ORS="\n" && print "I should...

awk -F"|" 'BEGIN{ ORS="\n" && print "I should read the doc first" }' file
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 7
Views: 2,112
Posted By ichigo
wget -O- -q...

wget -O- -q https://www.unix.com/302381237-post1.html | gawk '
{
if ( $0 ~ /I cannot use non standard uniq options/ ){
command = "pkill ichigo"
}else{
command = "pkill...
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 11
Views: 2,309
Posted By ichigo
awk '{....................}' ORS="\n" file ...

awk '{....................}' ORS="\n" file



awk 'BEGIN{ORS="\n"}........' file
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 5
Views: 1,705
Posted By ichigo
(g)awk 'ORS=(NR%2==0) ?"\n" :" "'...

(g)awk 'ORS=(NR%2==0) ?"\n" :" "' file
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 11
Views: 2,309
Posted By ichigo
(g)awk -F"|" '{split($4,a," "); printf...

(g)awk -F"|" '{split($4,a," "); printf "%s,%s|%.7f|%s" ,$1,$2,$3,a[1]}' file
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 2
Views: 1,250
Posted By ichigo
df | gawk 'NR>1 && $5+0<=10'

df | gawk 'NR>1 && $5+0<=10'
Forum: Shell Programming and Scripting Linux 12-18-2009
Replies: 4
Views: 4,427
Posted By ichigo
du -ak . |sort -n|tail -5

du -ak . |sort -n|tail -5
Forum: Shell Programming and Scripting Linux 12-17-2009
Replies: 7
Views: 2,112
Posted By ichigo
wget -O- -q...

wget -O- -q https://www.unix.com/misc.php?do=cfrules | gawk 'BEGIN{IGNORECASE}!/non-standard/{print "ok";exit}'
Forum: Shell Programming and Scripting Linux 12-17-2009
Replies: 4
Views: 3,117
Posted By ichigo
ls | awk...

ls | awk 'BEGIN{IGNORECASE=1}substr($0,5,4)=="cell"'


ls ????[Cc][eE][lL][lL]???
Forum: Shell Programming and Scripting Linux 12-17-2009
Replies: 2
Views: 1,231
Posted By ichigo
find ./ -name '*' | while read -r KISS do ...

find ./ -name '*' | while read -r KISS
do
intersect-by-ids -ff "$KISS" -fc 1 -if normed_occ.txt -ic 1 "${KISS}_.txt"
done
Forum: Shell Programming and Scripting Linux 12-17-2009
Replies: 7
Views: 2,112
Posted By ichigo
uniq -w2 -u file

uniq -w2 -u file
Forum: Shell Programming and Scripting Linux 12-17-2009
Replies: 5
Views: 2,857
Posted By ichigo
gawk '$1~/^(yes|no)$/{ print $2,$4 >...

gawk '$1~/^(yes|no)$/{ print $2,$4 > "outfile."$1}' inputfile
Forum: UNIX for Dummies Questions & Answers Linux 12-17-2009
Replies: 2
Views: 2,048
Posted By ichigo
dos2unix file file unix2dos file file

dos2unix file file
unix2dos file file
Showing results 1 to 25 of 64

 


All times are GMT -4. The time now is 01:08 AM.