Search Results

Search: Posts Made By: khchong
1,558
Posted By khchong
It worked for me, thank you so much! Will perform...
It worked for me, thank you so much! Will perform more searching in the forum moving forward.
1,558
Posted By khchong
Hi, This is for bash shell. Yes, I tried...
Hi,

This is for bash shell.
Yes, I tried below:
cat test.txt |awk '{print substr($1, 1, length-1)}'

test.txt:
SCDE1
SF9
STR1D2
SREDF21
FRED
STER2R4

Output:
SCDE
SF
STR1D
SREDF2...
1,558
Posted By khchong
Removing numbering from last character
Hi,
I have a file test.txt, below the contents:

SCDE1
SF9
STR1D2
SREDF21
FRED
STER2R4


I want to remove only the last character if it is the number, so the output should as below:
...
978
Posted By khchong
Appending line
Hi,

I have a file with below contents:

vi testcode.txt
123,
2,
3,
4,
5,
6,
7,
8



The above is an example, but in real I have hundreds of lines in the file, and I would like to...
1,074
Posted By khchong
Hi, This is my text file: This is the...
Hi,

This is my text file:

This is the first test from a1.loa1 a1v1, b2.lob2, "c3.loc3" c3b1, loc4 but not from mot3 and second test from a5.loa5

The output should look at below:

a1.loa1...
1,074
Posted By khchong
How to grep keywords?
I have below text file only with one line:

vi test.txt

This is the first test from a1.loa1 a1v1, b2.lob2, "c3.loc3" c3b1, loc4 but not from mot3 and second test from a5.loa5


Below should...
1,558
Posted By khchong
awk - how to add empty line
hi,

how should i add an empty line to my file,
example, below myfile.txt
"
this is first line
this is second line
this is third line
"

I would like the file formated as below by adding an...
1,110
Posted By khchong
awk - make new line
Hi,

I would like to make a new line example like below:

"When you post an item you can just delete the files."

every 3 words of the above sentence I would like to make a new line like below:...
1,558
Posted By khchong
How to make a new line of the file?
Hi,

I have a file (newfile.txt) with the contents below:
This is a new file. This is a new file. This is a new file. This is a new file.

How could I make a new line of the file as below?
This...
1,787
Posted By khchong
Hi, Im using hpux 11.31
Hi,
Im using hpux 11.31
1,787
Posted By khchong
Hi, I don't have the v option, ls -lv gave me...
Hi,
I don't have the v option, ls -lv gave me error
any other alternative?
1,787
Posted By khchong
Hi, thanks for the coding. I have below...
Hi,
thanks for the coding.
I have below files in my server:
output1.log
output2.log
output3.log
output4.log
output5.log
output6.log
output7.log
output8.log
output9.log
output10.log...
1,787
Posted By khchong
Script to email status
Hi,

I have few processes in the server continuous run few jobs, each of the process will generate a log file which detailing when its jobs are completed.
the logfile will has the name something...
1,990
Posted By khchong
Hi, I have below code: vi test.sh ...
Hi, I have below code:

vi test.sh


#!/bin/ksh
CHKTEST=`cd /tmp;ls test1.log> /dev/null 2>&1`
CHKTESTRESULT="test1.log"
[[ CHKTEST = CHKTESTRESULT ]]
echo $?


When i ran ./test.sh, I...
1,990
Posted By khchong
Comparing files and capture return code
Hi,

I would like to compare 2 files, and have a return code write to a file.
regardless of the files contents are the same the code should be writing to a file (if both files contents are same...
12,798
Posted By khchong
sorry of the dummy question: if [ "${XSTAT}"...
sorry of the dummy question:
if [ "${XSTAT}" -gt 0 ]; then

is -gt means not equal to 0?
12,798
Posted By khchong
Unix return code example
Hi,

Does anyone here can guide me to understand how is return code works in a parent-child relation with a simple example?
I have a request to build the script with return code in a child...
1,062
Posted By khchong
Any other way to do it, let say if we use if then...
Any other way to do it, let say if we use if then else?
thanks
1,062
Posted By khchong
compare files
Hi,

I have 2 files (1stfile.log, 2ndfile.log)

Contents of the files:

1stfile.log:
GERMANY01
UK11
US11
ITALY11

2ndfile.log:
Germany01
US11
UK11
ITALY22
BELGIUM11
CHINA11...
2,232
Posted By khchong
check file in ksh
Hi,

I have a file with below contents, 3 lines, all are PASS:
cat filetest.log
PASS
PASS
PASS

I would need to check this file to ensure the contents are remain unchanged with only 3 lines...
1,241
Posted By khchong
Hi, Thanks a tons! Is there anyway i can...
Hi,
Thanks a tons! Is there anyway i can construct this using if-then-else? just wondering how do you manually create the process fin_tr_APPADJi, fin_tr_APPADJ and fin_tr_APPADJnox?

----------...
1,241
Posted By khchong
How to verify process as uppercase
Hi,
I'm using ksh, I have a server process run in the background called fin_tr_APPADJ. I have a requirement now to create a script to check if all the processes spawn with process named fin_tr_*...
1,689
Posted By khchong
Hi, What if I my text file (myFile) I have...
Hi,

What if I my text file (myFile) I have space and numeric, the above will return 1 even no small capital was found, anyway to get over space and numeric and return 0 if all capital letter...
1,689
Posted By khchong
Hi, Thanks again. What about if i want to...
Hi,
Thanks again. What about if i want to return 0 for all uppercase else return 1?
1,689
Posted By khchong
hi, Thanks for the suggestion. I can't find...
hi,
Thanks for the suggestion. I can't find nawk command, but i do find awk.
my OS is hpux B.11.31
many thanks
Showing results 1 to 25 of 27

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