Search Results

Search: Posts Made By: Rajesh Kumar
2,435
Posted By Rajesh Kumar
try this ..
Once you have created the txt file report , you can BOLD the "No error " using,

sed s/No error/$(tput bold)No error$(tput sgr0)/ report.txt > temp
mv temp report.txt
17,064
Posted By Rajesh Kumar
To get the line number ...
Sorry, to get the line number, keep incrementing a variable and get that printed/stores when the match is found.
17,064
Posted By Rajesh Kumar
Not the best way, but it works
Not the best one , but willl work. This works only if the file is in the specifed format, or else may result in inconsistent results ...take care.


team$ cat myfile :) ---Just copied from your...
4,820
Posted By Rajesh Kumar
see if this helps ...
The main.sh is a dummy script that writes some info to outfile.

team$ cat main.sh
#!/usr/bin/ksh

i=1

while [ $i -le 5 ] ; do

if [ $i -eq 5 ]; then
echo "TRL" >>...
5,967
Posted By Rajesh Kumar
try this ..
if your filenames are of fixed length and you just need to remove the first two chars and last char and rename it , then this might help,


team$ filename="3p1522015.dgn"
team$ basename $filename...
1,505
Posted By Rajesh Kumar
try this ..
team$ val=`echo 20 ^À-`
team$ echo $val
20 €-
team$ echo $val | sed s/"$val"/-20/
-20
team$
23,248
Posted By Rajesh Kumar
Not sure if I understood it properly ..
If your requirement is to check if the word is present in a particular line , in a file, and assign the found word ( or the search word , as both will be same , if it is found ) then , I think this...
12,394
Posted By Rajesh Kumar
Noted your trick , thanks Ghostdog
:cool: Ghostdog , that was a good piece, But at times feel I can type "grep -v grep " much faster than trying to escape the /'s when using awk.

for an example , to grep the '/etc/init' , I feel...
31,978
Posted By Rajesh Kumar
Ragavendran, see if this helps
team$ cat numbers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
team$

team$ cat lines.sh
#!/usr/bin/ksh
2,984
Posted By Rajesh Kumar
As per my understanding from your requirement ..
1) you are running a process in the remote host. It will give its return code to a file on the remote host.

2) you need to " ps -ef | grep " and see if the process that you evoked in step (1) has...
12,394
Posted By Rajesh Kumar
This might also work
ps -ef | grep your_process | grep -v grep | tr -s " " | cut -f2
3,045
Posted By Rajesh Kumar
My first contribution ...to this forum
#! /usr/bin/ksh

interval=900 ## check for logfile size once in this much seconds

while true ; do
size_of_file=`ls -l logfile | awk '{ print $5}'`

if [ ${size_of_file} -ge 1024 ]...
Showing results 1 to 12 of 12

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