10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
So I am writing a bash script that will search a file line by line for unix timestamps, store all of the timestamps into an array, then check how many of those timestamps were created within the last hour, and finally increment a counter every time it finds a timestamp created within the last hour.... (6 Replies)
Discussion started by: jsikarin
6 Replies
2. Shell Programming and Scripting
Hi,
I have a text file with some thousands of rows of the following kind (this will be referred to as the inputFileWithColorsAndNumbers.txt):
Blue 6
Red 4
Blue 3
Yellow 4
Red 7
Colors in the left column and a number in the right one for each line. I want to run an awk... (5 Replies)
Discussion started by: Zooma
5 Replies
3. Shell Programming and Scripting
My original post did not show up properly. I am trying again.
I have a simple tsch script that does some basic arithmetic. The calculated value was not producing the result I was expecting. I wrote a sample script to illustrate the things that I tried.
#!/bin/tcsh
@ count = 43
@... (3 Replies)
Discussion started by: sgualandri
3 Replies
4. Shell Programming and Scripting
Hey guys, awk is putting out too many results, two of each specifically. See below.
Code:
read CPU_VENDOR_ID <<< $(cat /proc/cpuinfo | grep "vendor_id" | awk -F: '{print $2}')
echo $CPU_VENDOR_ID
echo
Output:
AuthenticAMD AuthenticAMD
I only want it to print out "AuthenticAMD" once.
... (7 Replies)
Discussion started by: 3therk1ll
7 Replies
5. Shell Programming and Scripting
Hi
I want to perform arithmetic operations on output of `wc -l`.
for example
user046@sshell ~ $ ls -l
total 0
where "total 0" will increase one line in wc -l
filecount=`ls -l | wc -l`
here $filecount will be 1 but is should be 0
how to get rid of it ? (1 Reply)
Discussion started by: anandgodse
1 Replies
6. Shell Programming and Scripting
Hi
I have a file with 3 columns. say,
infile:
1 50 68
34 3 23
23 4 56
-------
-------
I want to generate n files from this file using a loop so that 1st column in output file is (column1 of infile/(2*n+2.561))
I am doing like this:
for ((i=1; i<=3; i++))
do
a=`echo... (3 Replies)
Discussion started by: Surabhi_so_mh
3 Replies
7. Shell Programming and Scripting
Hello everyone,
I need some assistance with what I thought would have been a very simple script.
Purpose of Script:
Script will parse through a source file and modify (search/replace) certain patterns and output to stdout or a file. Script will utilize a "control file" which will contain... (12 Replies)
Discussion started by: packetjockey
12 Replies
8. Shell Programming and Scripting
Hi all,
Could someone please advise what is the correct syntax for my little script to process a table of values?
The table is as follows:
0.002432 20.827656
0.006432 23.120364
0.010432 25.914184
0.014432 20.442655
0.018432 20.015243
0.022432 21.579517
0.026432 18.886874... (9 Replies)
Discussion started by: euval
9 Replies
9. Shell Programming and Scripting
I have file with this type of format
01.02.09 08:30
bob
jill
mark
01.04.09 07:00
bob
jill
mark
tom
I want to count the names after the date /ime line (01.02.09 08:30) and add that number after the time like this
01.02.09 08:30 3
01.04.09 07:00 4
I don't care about... (6 Replies)
Discussion started by: marcelino
6 Replies
10. Shell Programming and Scripting
I have a forloop which checks a log for a set of 6 static IP addresses and each IP found is logged to a file which is then mailed to me.
After the forloop I always have a text file that may contain up to 6 IP addresses or may contain 0.
What I want to do is substitute the IP addresses (if any)... (2 Replies)
Discussion started by: Moxy
2 Replies