Search Results

Search: Posts Made By: svajhala
1,339
Posted By Don Cragun
Your tail | tail pipeline will never end. The...
Your tail | tail pipeline will never end. The 2nd tail reads one line from the end of the pipeline; but, since the tail -f will never terminate, the pipeline won't deliver an EOF to the 2nd tail...
9,065
Posted By Scrutinizer
Try: awk '{for(i=1; i<=NF; i++) sub(/^[ \t]+|[...
Try:
awk '{for(i=1; i<=NF; i++) sub(/^[ \t]+|[ \t]+$/,x,$i)}1' FS=\| OFS=\| file
1,311
Posted By apmcd47
Look at using the following: import shlex ...
Look at using the following:

import shlex
import subprocess
conn_fl = ptfm_dgnst['conn_fl']
subprocess.call(shlex.split(conn_fl))

Not checked. You will need to read up on shlex and...
3,349
Posted By gandolf989
You might find it easier to write a bash script...
You might find it easier to write a bash script that does what you want it to do,
scp it to each of the servers, then run that script remotely with the '-C' parameter.
Here is some sample code.
...
3,349
Posted By Scrutinizer
Hi, the while-read loop is taking stdin away from...
Hi, the while-read loop is taking stdin away from the ssh command. Try:
while read line <&3
do
....
done 3<${HOME}/hosts.txt
2,035
Posted By bakunin
df has - per the POSIX-definition...
df has - per the POSIX-definition (http://pubs.opengroup.org/onlinepubs/007904875/utilities/df.html) - the option "-P" for exactly this: formatting the output in a consistent way across all...
2,035
Posted By sea
From what i've found, it seems to valid for...
From what i've found, it seems to valid for mountpoints with spaces in any of the directory structure segments.

With this code, only the first part of a path with a space will be read, and will be...
2,035
Posted By MadeInGermany
The NetApp .snapshot is not visible in all cases....
The NetApp .snapshot is not visible in all cases.
Try
[ -d "${line}"/.snapshot/. ]
or use the exit status of cd
if cd "${line}"/.snapshot
then
echo "backup"
else
echo "does not exist"...
2,035
Posted By sea
Remove the red marked exclamation mark: if [...
Remove the red marked exclamation mark:
if [ "${fdate}" != "${bkp_fldr_timestamp}" ]
As it claims that there is no snapshot, eventhough both dates are found (date + folder), the negation of the...
2,584
Posted By vgersh99
you don't need 'active function' for sqlplus -...
you don't need 'active function' for sqlplus - remove the` from `sqlplus -s $SQL_LOGON and from EOF`
Forum: AIX 03-12-2014
2,760
Posted By vbe
Why not? You have 4 logical servers, each...
Why not?
You have 4 logical servers, each having their own IP etc...
3,031
Posted By alister
sed -n '/^Thread \[/ { s///; s/_.*//; N; N; N; p;...
sed -n '/^Thread \[/ { s///; s/_.*//; N; N; N; p; }'
Regards,
Alister
3,031
Posted By MadeInGermany
Move the P (print if P is not 0) before the...
Move the P (print if P is not 0) before the /Busy/ {exit}
3,031
Posted By hanson44
$ sed -n "/^Thread/,/Busy Percentage/ { s/^Thread...
$ sed -n "/^Thread/,/Busy Percentage/ { s/^Thread .//; s/_.*//; p}" input
TRANSF
Total Run Time = [338.043617] secs
Total Idle Time = [0.000000] secs
Busy Percentage =...
3,031
Posted By Jotne
This is close to what you tried in post #1, and...
This is close to what you tried in post #1, and should work
awk '/TRANSF_/{f=1} f {print; if ($0~/Busy/) exit}' sess.log
Thread [TRANSF_1_1_1] created for [the transformation stage] of partition...
3,031
Posted By Yoda
Explanation: awk -F'[][]' ' ...
Explanation:
awk -F'[][]' ' # Set [ ] as field separators
/^Thread/ { # Search if record begins with pattern: Thread
...
2,710
Posted By Corona688
This is wrong: EOF It needs to be: EOF...
This is wrong:
EOF
It needs to be:
EOF You cannot indent the ending-tag of a here-document. (The special kind which can needs to be indented with tabs, and is confusing to use, so I don't...
2,343
Posted By gary_w
The if statement right above the else does not...
The if statement right above the else does not end with a "fi".
1,636
Posted By rdcwayx
awk '{a=a FS substr($0,1,10);b=b FS...
awk '{a=a FS substr($0,1,10);b=b FS substr($0,12,3);c=c FS substr($0,16,5);d=d FS substr($0,22,8);e=e FS substr($0,31)}
END{gsub(/ *$/,"",a);gsub(/ /,"",b);gsub(/ /,"",c);gsub(/ /,"",d);print...
1,856
Posted By Skrynesaver
tail -1will return the last entry (if that is...
tail -1will return the last entry (if that is always the correct one for you), otherwise you could pipe through grep first in order to discard unwanted entries prior to printing the last valid entry,...
1,856
Posted By Tommyk
ls -lart *.dat|grep -v resend | tail -1 ...
ls -lart *.dat|grep -v resend | tail -1


returns the listing in ascending time modified order of only files ending in .dat, removes anything containing resend in the line, and shows only the last...
9,857
Posted By Chubler_XL
The supplied code only works with GNU awk for...
The supplied code only works with GNU awk for plain awk you might need something like this:
awk '!$0;$0{printf $0" "}END{print}' infile

Another version with extra space on end of each line...
9,857
Posted By DGPickett
Back in #1 there were blank lines so 4 was a good...
Back in #1 there were blank lines so 4 was a good number.
9,857
Posted By Scrutinizer
It only works when there are empty lines between...
It only works when there are empty lines between the records, as is the case in the sample input file.
9,857
Posted By DGPickett
A bit fork/exec intensive, but yes, that is...
A bit fork/exec intensive, but yes, that is another way to collect N lines into one:xargs -n4 echo < file
Showing results 1 to 25 of 37

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