Search Results

Search: Posts Made By: ongoto
14,526
Posted By ongoto
Love them one liners. :) #!/bin/bash ...
Love them one liners. :)

#!/bin/bash

while read f2
do
kee2=${f2##*,}
line=$(grep $kee2 file1)
if [[ $line && $(echo $line | cut -d, -f12) == 1 ]]; then
srch=$(echo...
Forum: What is on Your Mind? 12-30-2014
1,672
Posted By ongoto
While Happy; do @ ;done < 2015
http://i62.tinypic.com/zt6a08.jpg
1,612
Posted By ongoto
@acdc I played with your original code a little...
@acdc
I played with your original code a little and shamelessly stole the %COUNTS array from derekludwig. I came up with this without much regex...
#!/usr/local/bin/perl -w

use warnings;
use...
4,059
Posted By ongoto
Edit: Code removed: not working right.
Edit:
Code removed: not working right.
3,047
Posted By ongoto
Nothing major. It looks like part of your code...
Nothing major.
It looks like part of your code (in red) is missing...read iname
[ $iname ] || output;
if [ $iname -gt $SIZE ] || [ $iname -lt 1 ]; then
echo "Choice is out of range"
...
3,047
Posted By ongoto
You have to be careful not to enter a number that...
You have to be careful not to enter a number that is out of range. (zero or greater than the size of the list)

I made a few changes to catch that error and another bug I discovered...
function...
3,047
Posted By ongoto
An attempt to stay close to your original...
An attempt to stay close to your original script...
#!/bin/sh

declare -A AGES # associative name/ages array
NAMES=($(cat names.data | sort -u)) # unique names array...
1,410
Posted By ongoto
This is a bit of a mess, but it works here. ...
This is a bit of a mess, but it works here. Might need some tweaking.
printf "Enter the two digits of your sum: "
## get cursor position
echo -en "\E[6n"
read -sdR posn
posn=${posn#*[}...
Forum: Programming 01-12-2015
2,888
Posted By ongoto
Will this work? total = 0 for c in '1.32',...
Will this work?
total = 0
for c in '1.32', '5.32', '4.4', '3.78':
c = float(c)
total += c
print totalIt might also work without c = float(c)
# c = float(c)
total += float(c)
2,517
Posted By ongoto
Can't explain why, but this works right. There...
Can't explain why, but this works right. There may be a shopt <option> to change the variable expansion rule??
set 1 2 4 11 "dogs mouse cars" 50 19 "noise toys"
7,473
Posted By ongoto
ntfs is a windows file system. nothing wrong...
ntfs is a windows file system. nothing wrong with storing files to be shared, but linux scripts don't belong there. by the same token, windows *.exe files don't belong on a linux file system.
You...
3,133
Posted By ongoto
Will GAP number and RMS num ever be in the same...
Will GAP number and RMS num ever be in the same line?
or is the test to be for their one time occurance in the whole file?
1,135
Posted By ongoto
An example in Bash...just ignores the ---------...
An example in Bash...just ignores the --------- field.
#!/bin/bash

file="./lineup.data"

while read fld1 fld2 fld3
do
if [[ ${fld1:0:1} == 's' ]]; then
printf "%-24s ,%s\n" " "...
12,265
Posted By ongoto
You could also try escaping back quotes.. ...
You could also try escaping back quotes..
counter=\`expr \$counter + 1\`
8,657
Posted By ongoto
A program which extracts the values you want to...
A program which extracts the values you want to see shouldn't be hard to do, but you will have to edit the parameters.txt file yourself and provide the values you want to see, and omit what you dont...
Forum: Programming 01-04-2015
2,211
Posted By ongoto
That is possible. I can't remember all the type...
That is possible. I can't remember all the type checking details used in those days either. One way Bash (nowadays) distinguises between a variable named 'func' and a function named 'func()' is the...
8,657
Posted By ongoto
Parameter Ideal Value Cell Name ...
Parameter Ideal Value Cell Name Actual Value
--------- ----------- --------- ------------
accmin Ranges RBR201A 100
cchpwr 33 ...
8,657
Posted By ongoto
Also for discussion, here's how...
Also for discussion, here's how CNAI_DUMP_RAW1.txt appears when loaded into Gnumeric. Each line extends to column EZL. I don't suppose it matters how many columns that is?...
Forum: Programming 01-04-2015
2,211
Posted By ongoto
Part of an if statement can be to call (fork) an...
Part of an if statement can be to call (fork) an external function; e.g. sed. You could say a == (the results of) sed /something/ for example. ccode is just the name of a variable. Judging by the...
Forum: Programming 12-31-2014
2,211
Posted By ongoto
I meant no offense. I'm just going along with...
I meant no offense.
I'm just going along with what you said. The questions you raised supports the fact that it doesn't make any sense, right?

if (exp()) is asking if the function exists; it's...
1,284
Posted By ongoto
If it's just about line numbering... nl -s ''...
If it's just about line numbering...
nl -s '' -w3 -nln file2 > file1
2,860
Posted By ongoto
Sorry. :p I don't know enough about screen or...
Sorry. :p
I don't know enough about screen or servers to help you there. I'm sure someone will come along who does.
2,860
Posted By ongoto
Screen is a pretty complex monster. There is a...
Screen is a pretty complex monster. There is a command to list sessions...
screen -ls
screen --listYou might be able to incorporate that output into your scripts.
See man screen
2,860
Posted By ongoto
RE: status If you are going to test Pidfile for...
RE: status
If you are going to test Pidfile for zero lines, if test `ps -e | grep -c $Pid` = 0; then... try > $Pidfile # instead of echo $! > $Pidfile when you 'stop' or initialize $Pidfile
1,865
Posted By ongoto
Another bash attempt... #!/bin/bash ...
Another bash attempt...
#!/bin/bash

hist=./hist
data=./abc.data
sort -k 2 -u $data -o $hist

while read a b
do
a=0
while read aa bb
do
if [[ "$bb" == $b ]]; then
...
Showing results 1 to 25 of 48

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