Search Results

Search: Posts Made By: Tytalus
1,422
Posted By Tytalus
Is this close to what you're after : awk...
Is this close to what you're after :


awk '{n=NF;for (i=1;i<=n;i++){t[i]=t[i]" "$i}}END{for (i=1;i<=n;i++){print t[i]}}' tmp1 tmp2
1,402
Posted By Tytalus
what language/shell/OS ?
what language/shell/OS ?
3,409
Posted By Tytalus
many ways to skin your cat... e.g. bash: ...
many ways to skin your cat...

e.g. bash:

# echo {1..1000}|tr " " "\n">file
2,351
Posted By Tytalus
using sub changes 1st instance: # echo...
using sub changes 1st instance:

# echo "hello,,world,,how, are,,you" | nawk '{sub(",,",",",$0);print}'
hello,world,,how, are,,you

using gsub changes all instances:

# echo...
1,615
Posted By Tytalus
something along the lines of: (rewriting...
something along the lines of:


(rewriting your equation to isolate an iteration:

x=y/ln(3.455613x)
)

# y=1;x=1;for i in {1..100}; do x=$(calc "$y/(log(3.455613*$x))"); echo $x;done...
1,765
Posted By Tytalus
one way: # mv File1.txt $(sed q...
one way:


# mv File1.txt $(sed q Filename.txt)
6,665
Posted By Tytalus
unless I'm missing something cp...
unless I'm missing something


cp /home/test/subdir/file1 /home


will do what you want
1,490
Posted By Tytalus
well, your 49 record actually conatins one less...
well, your 49 record actually conatins one less zero than you stated you're looking for, but with that caveat (and using the shorter string, would :


# egrep -v "^(03|49).*00000000000000000"...
Forum: HP-UX 07-04-2011
8,679
Posted By Tytalus
Is this a question ? or a statement ? If you...
Is this a question ? or a statement ?

If you are looking for assistance you will need to provide more info.

When you say "automatically restart the server" do you mean it's in a reboot cycle...
2,464
Posted By Tytalus
it would appear your answer was provided in...
it would appear your answer was provided in another forum in 2002:

database growth script - DBAsupport.com Forums (http://www.dbasupport.com/forums/showthread.php?t=23118)

HTH :-)
3,397
Posted By Tytalus
something like: # nawk -F"[_.]"...
something like:


# nawk -F"[_.]" '!/thumb/{print} /thumb/{print "<link>preview_"$2".html</link>"; print "</objects>";print}' infile
<objects/>
<link>preview_0001.html</link>
</objects>...
13,449
Posted By Tytalus
some possibilities: # nawk...
some possibilities:


# nawk 'NR%3!=0{printf "%s", $0;next}1' infile
1,2,3,
4,5,6,

# nawk 'ORS=(FNR%3)?FS:RS' infile
1, 2, 3,
4, 5, 6,

# paste - - - < infile
1, 2, 3,
4, ...
2,131
Posted By Tytalus
cheap and dirty: # awk...
cheap and dirty:


# awk '/^M/{t=$1;getline;t=t""$(NF-3)" "$(NF-2)" "$(NF-1)" "$NF;print t}' infile
M5.7&a......... 6 violations found.
M6.7&a......... 6 violations found.


(if you match a...
Forum: Programming 06-27-2011
5,818
Posted By Tytalus
been a long time since I played with...
been a long time since I played with fortran...but

Immediate questions -:

what version are you running and on what OS ?

are you opening all files concurrently or sequentially; are you...
2,360
Posted By Tytalus
# nawk -F"\"" '{OFS=FS;gsub(",","",$2);print}'...
# nawk -F"\"" '{OFS=FS;gsub(",","",$2);print}' infile
first,"Street1City1Country1",test1
second,"Street2City2","test2"
third,"Street3City3Country3","A,B,C,D,E"
fourth,"ABCDE",test4"


HTH
Forum: Linux 06-16-2011
2,377
Posted By Tytalus
any restrictions on layout/format ? i.e. do you...
any restrictions on layout/format ? i.e. do you want the first row of o/p to be the first 2.5 rows of input, 2nd row next 2.5 etc ?

Anyway...assuming fields are space seperated this random hack:...
3,042
Posted By Tytalus
Are you running the script as the same user that...
Are you running the script as the same user that the crontab is for ?

potentially you have environment issues....

you may want to explicitly su to the user (/usr/bin/su USER -c '....') within...
7,134
Posted By Tytalus
would suggest you could either try escaping...
would suggest you could either try escaping (sdfg\@fgh ) or quoting ('abcd@defg')


but since I'v never come across @ in a username before, out of interest, what OS are you on that allows "@" to...
2,383
Posted By Tytalus
other than the standard suggestion that you...
other than the standard suggestion that you should not use csh....


ls wibble
wibble: No such file or directory

% echo wibble>testfile
% set file = testfile
% echo $file
testfile

% mv...
2,303
Posted By Tytalus
Hi, you'll probably find what you're after...
Hi,

you'll probably find what you're after in the FAQ: https://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html

but in case you've already looked, what...
2,892
Posted By Tytalus
something like : # paste - - - < infile ...
something like :


# paste - - - < infile
Alpha<>123 AAAA<>6754 Beta<>456
BBBB<>63784 CCC<>783 Gama<>789
Alpha<>555 AAAA<>6754 BBBB<>63784
Beta<>666 ...
1,877
Posted By Tytalus
# nawk '$0~":"&&t!=""{print $0" is incorrect...
# nawk '$0~":"&&t!=""{print $0" is incorrect format"}{t=$0}' infile
Banana: is incorrect format


HTH
1,357
Posted By Tytalus
something like: # nawk -F","...
something like:


# nawk -F"," '{($2~"errorcode") ? t[$3]=$2 : s[$3]=$4 }END{for (x in t){print x,t[x],s[x]}}' infile
messageID errorcode sha


should be close to what you're after.

HTH
9,636
Posted By Tytalus
not sure exactly what you mean...do you want all...
not sure exactly what you mean...do you want all months for a given year ? or all successive months, or just next month?

here's a start point for you to have a play with:


# for x in {1..12};...
15,335
Posted By Tytalus
A quick search on the site throws up: ...
A quick search on the site throws up:

https://www.unix.com/shell-programming-scripting/29337-get-last-5-minutes-log-log-file.html

wherein you may find what you require :-)
Showing results 1 to 25 of 500

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