Search Results

Search: Posts Made By: JSKOBS
3,449
Posted By JSKOBS
We have existing function ("fun1") with complex...
We have existing function ("fun1") with complex calculations. For the sake of simplicity, i havn't mentioned here.
As part of reusability, we are asked to call this function wherever needed.
3,449
Posted By JSKOBS
Call user defined function from awk
My requirement is to call function ("fun1") from awk, and print its returned value along with $0.
fun1()
{
t=$1
printf "%02d\n", $t % 60;
}

echo "Hi There 23" | awk '{print $0;...
946
Posted By JSKOBS
Field seperator with awk
Hi, input data format:
echo ' <APPLICATION="APPLSG" SUB_APPLICATION="DLY" JOBNAME="DPL_BN_RE_CCMS_SA" CMDLINE="run_job.ksh %%PARAM1 %%PARAM2" TASKTYPE="Command" />'

expected format:...
857
Posted By JSKOBS
Hi Rudic, thanks for reply. one question. how...
Hi Rudic, thanks for reply. one question.
how to stop printing header if there are no 'Job name/Created on/Modified on' match..
857
Posted By JSKOBS
Pivoting with awk
My input file(inputfile.txt):

Job name.... EXTDPL_1
Created on.. 2018-11-19 14:00:00
Modified on. 2018-11-22 11:54:46

Job name.... EXTDPL_2
Created on.. 2018-11-21 12:31:27


Modified on....
777
Posted By JSKOBS
Apologies, i missed in my command, updated...
Apologies, i missed in my command, updated command below:
echo -e "MMS000101S0203430A|20180412E|\nMMB0001INVESTMENT||107-86193-01-03|\nMMB0001FUND||107-86193-04-01|\nMMC9991 " | awk -F'|' -v OFS=,...
777
Posted By JSKOBS
Combine awk scripts
Hi, Below command is working as expected, but would like to know how to club the two AWK scripts in the command into one
echo -e...
717
Posted By JSKOBS
Group and search using awk
file:

Data has to be grouped on 1st field; And in each group, print 2nd field IF 1st field doesn't match with any of the values in 2nd field..
o/p to be:


I ended up writing as below, any...
4,915
Posted By JSKOBS
Append header with awk
I have to append the header (ie "START OF LINE") to a file only if there is data in it.
Below command is showing header though there is no data in a file, can you suggest how to correct..
awk...
842
Posted By JSKOBS
It should be first occurrence from search of all...
It should be first occurrence from search of all files..
Problem with my command: returning 2nd field of all search results...
842
Posted By JSKOBS
awk search and get top record
im trying to search for a keyword called ($Temp) in a DIRECTORY, get the top record from this search, and print 2nd field.
here is my command, can you plz let me know what is wrong

awk -F"="...
5,077
Posted By JSKOBS
records of kind 3rd row should be below: (Blank...
records of kind 3rd row should be below: (Blank if No date & Month; Blank if no decimal at the end of 2nd field of input file)

3||MIN BAL|| LEX

---------- Post updated at 06:49 AM ----------...
5,077
Posted By JSKOBS
Do you really want to truncate the contents of...
Do you really want to truncate the contents of the newly created 3rd field if input field 2 contains more than 47 characters?
- i dont want to truncate. i didn't get logic so i mentioned values...
5,077
Posted By JSKOBS
awk Index to get position matches pattern
Input data as below (filetest.txt):
1|22 JAN Minimum Bal 20.00 | SAT
2|09 FEB Extract bal 168.00BR | REM
3|MIN BAL | LEX

Output should be:
( If there is Date & Month in 2nd field of Input...
1,338
Posted By JSKOBS
im calling the script from control-m scheduler ...
im calling the script from control-m scheduler
abnormal termination of the script will be detected with exit 1 or 2 or 5. Successful is exit 0
with the provided changes, it is mailing till...
1,338
Posted By JSKOBS
Hi @drysdalk , its -bash
Hi @drysdalk , its -bash
1,338
Posted By JSKOBS
@drysdalk, @rbatte1 Thanks for reply. I tried...
@drysdalk, @rbatte1
Thanks for reply. I tried the code suggested, but couldn't identify that script abended after mailing.
Can you please clarfy how the script abend after mailing (but continue...
1,338
Posted By JSKOBS
Need info on looping
My script will do:
while true
do
if [[ -s file.txt ]]; then
### here im mailing content of file.txt
fi

if [[ -e End_of_day.log ]]; then
exit 0
fi

sleep 30m
done


If i add...
801
Posted By JSKOBS
If loop query
Hi, its getting aborted with below IF loop, can plz guide me what im missing here

if [ -z "${APPEND}" ] || [ $($APPEND+1) % 3 -eq 0 ]; then
echo "print $APPEND"
fi
10,379
Posted By JSKOBS
sub-process execute commands include dsjob -run. ...
sub-process execute commands include dsjob -run.

so, can i search this way:
ps -eo etime,pid,cmd | grep "dsjob.*run"
10,379
Posted By JSKOBS
Thanks for the reply. Can i search this way...
Thanks for the reply.

Can i search this way to list sub-processes :
ps -eo etime,pid,cmd | grep "sub-process_name"

Here is the output of uname -a command:
Linux DG10 2.6.18-308.13.1.el5 #1...
10,379
Posted By JSKOBS
Diff between "ps -ef"and "ps -eo"
Hi, have to list current running processes (including sub-processes/child processes). im using ps -eo etime,pid,cmd | grep "process_name"
But sometimes, the command is not listing the sub-processes....
2,208
Posted By JSKOBS
awk '{T = $0; gsub("[[:alpha:]]","X"); print...
awk '{T = $0; gsub("[[:alpha:]]","X"); print substr (T, 1, 7) substr ($0, 8)}' test.dat


Please use CODE tags as required by forum rules!
2,208
Posted By JSKOBS
Thanks for the reply. Can it be possible to...
Thanks for the reply.

Can it be possible to replace only characters, excluding numbers & first 7 characters (output as below...)
2,208
Posted By JSKOBS
Masking with gsub command
My file "test.dat" data as below

Requirement is to mask(replace) all english characters with "X" EXCEPT first 7 characters of every line.

my command
awk '{gsub("[[:alpha:]][^SECN]","X")}1'...
Showing results 1 to 25 of 78

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