Search Results

Search: Posts Made By: meharo
12,285
Posted By meharo
thanks anchal_khare, the command will give...
thanks anchal_khare,

the command will give combined cpu statistics as shown below:

Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%stbut i want it like when we...
12,285
Posted By meharo
Extract header from top command output
hi,

I want to extract and save the cpu(s) information from top command output, but individual cpu statistics separately on a multi-processor machine.

In command line, top will show this...
2,104
Posted By meharo
Why this is not working in expected way? (a question about the default bash behavior)
total=0

seq 1 5 | while read i ; do
total=$(($total+$i))
echo $total
done

echo $totalThis outputs:
1
3
6
10
15
0whereas I am expecting:
1
3
6
10
15
15My bash version:
2,712
Posted By meharo
#!/bin/bash ...
#!/bin/bash

my_file1="/mylocation/myfile1.log"
my_file2="/mylocation/myfile2.log"
my_string="Match Found"

tail -F "$my_file1" "$my_file2" | while read line ; do
if test -n "$(echo "$line"...
2,712
Posted By meharo
Suppose if you are looking inside file...
Suppose if you are looking inside file "/mylocation/myfile.log" for a particular string "Match Found", write a shell script as shown below and run it in background.

#!/bin/bash
...
8,674
Posted By meharo
thank you guys, the pattern is not as simple...
thank you guys,

the pattern is not as simple as a single line or always the link starts with "../". It can be like <a href="anypath/anypage.jsp"> or multiple links present in the same line like <a...
8,674
Posted By meharo
pattern replace inside text file using sed
Hi,

I have a situation where I want to replace some occurrences of ".jsp" into ".html" inside a text file.

For Example:

If a pattern found like <a href="http://www.mysite.com/mypage.jsp"> it...
8,227
Posted By meharo
Hi, Find the project details below: ...
Hi,

Find the project details below:

inotify-tools (http://inotify-tools.sourceforge.net/)

This project provides some tools (your OS kernel should support) and it is very much easy to...
18,512
Posted By meharo
hi bulkbiz, Actually it is possible to...
hi bulkbiz,

Actually it is possible to hardcode a password inside shell script and hide it from casual viewers (not advanced viewers).

Either use,

gzexe - compress executable files in place ...
5,359
Posted By meharo
Hi prvnrk, #for "numbers existing in both...
Hi prvnrk,

#for "numbers existing in both files"
fgrep -f file2 file1

#for "existing in file1 but NOT in file2"
fgrep -v -f file2 file1

This will be one of the fastest solution in...
2,434
Posted By meharo
Hi, Execute the below BASH shell script and...
Hi,

Execute the below BASH shell script and take three output files generated, output1.log, output2.log and output3.log.

Note: Because the script needs to iterate through the whole log file at...
2,163
Posted By meharo
HI, You have to use "sshpass" the...
HI,

You have to use "sshpass" the noninteractive ssh password provider then.

If you try to provide password directly to ssh command, it will fail inside your shell script.

Download...
11,640
Posted By meharo
Tidy shell script source file
Hi all,

Is there a tool to tidy up shell script source file and reformat it. Preferably I am looking for a perfect tool to do this.

Also I have heard it is possible to do with emacs editor but...
Showing results 1 to 13 of 13

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