Search Results

Search: Posts Made By: ongoto
Forum: Programming 01-12-2015
3,780
Posted By Akshay Hegde
akshay@Aix:/tmp$ cat tmp.c #include <stdio.h> ...
akshay@Aix:/tmp$ cat tmp.c
#include <stdio.h>
#define N_ELEMENTS(array) (sizeof(array)/sizeof((array)[0]))


void main() {
int i, x, arr[10];

printf("Enter a word: ");

for (i...
3,576
Posted By Don Cragun
I assume Ravinder didn't reply to this because...
I assume Ravinder didn't reply to this because you pointed out that it didn't work correctly if the number of input fields wasn't an exact multiple of the number of desired fields on each output line...
1,282
Posted By Akshay Hegde
akshay@Aix:/tmp$ pr -m -t -s' ' file1 file2 1...
akshay@Aix:/tmp$ pr -m -t -s' ' file1 file2
1 aaa bbb ccc
2 ddd eee fff
3 ggg hhh iii
1,857
Posted By DGPickett
Not what you want, but what you asked for:a_sum=0...
Not what you want, but what you asked for:a_sum=0

while read a b c
do
if [ "$b" = "$c" ]
then
(( a_sum += a ))
fi
done <File1
You want the sum of column 1 for every set of column 2...
Forum: What is on Your Mind? 12-24-2014
2,220
Posted By Neo
Merry Christmas 2014
Merry Christmas to All. Peace on Earth and Goodwill toward Everyone

https://www.unix.com/members/1-albums112-picture653.jpg
11,072
Posted By Chubler_XL
Looks like the OP is long gone however here is a...
Looks like the OP is long gone however here is a good starting point for the bash version of that script. Again without the original data files and my limited knowledge of how split() and map()...
11,072
Posted By derekludwig
(The "do something if condition" is a DEC Basic+...
(The "do something if condition" is a DEC Basic+ idiom that perl adopted)

Not to join the language wars - but the moment someone says such-n-such a language is best is naive at best. It really...
11,072
Posted By wisecracker
Hi ongoto... Let me know when PERL,...
Hi ongoto...


Let me know when PERL, Python or nearly any other language for that matter, can do this:-

https://www.unix.com/os-x-apple-/246911-there-anything-shell-cant-do.html

I have made...
11,072
Posted By Corona688
It is already mostly "bash" code, in a...
It is already mostly "bash" code, in a membrane-thin wrapping of perl.

I don't think he's coming back at this point, we wanted him to do too much work.
11,072
Posted By Corona688
uname is not shell! Perl is using a shell here,...
uname is not shell! Perl is using a shell here, but it doesn't need to. You should use fork() and exec() to run it more efficiently. But then you would need to set up pipes and such to connect it...
2,157
Posted By Don Cragun
Note that in the original sample input in this...
Note that in the original sample input in this thread, the comma delimited field 7 and 8 for the 1st line is 4021375283,4021375682 HPAALI41215
not just 4021375283,4021375682. But, tweaking your...
4,360
Posted By junior-helper
Below is my awk + sort + awk approach. ...
Below is my awk + sort + awk approach.

Entries such as
cpq-media
cpq-telco
DSS-IPAD06
DSS-IPAD07
GSE-DocuSign
GSE-DocuSign1are considered "unclassified", because there is no "env"/number...
2,752
Posted By junior-helper
Yes. It's called indirect referencing. ...
Yes. It's called indirect referencing.
#!/bin/bash

list1="www.fsf.org www.defectivebydesign.org"
list2="www.gnu.org www.bash-hackers.org"
list3="www.linux-libre.fsfla.org www.stallman.org"
...
1,369
Posted By sea
Reading and Writing a conf file - Suggestions and improvements?
Hello all

As part of my TUI - (line based) Text User Interface (https://www.unix.com/shell-programming-and-scripting/253496-tui-text-user-interface-framework-scripts.html), i do have 2 commands to...
Forum: Programming 11-30-2014
5,837
Posted By totoro125
Cash Register Change Program
I just need some suggestions on how to start this program I wanted to work on for practice.
I want to make a cash register program that gives change and only works with $1's, $5's, $10's, and $20's...
3,370
Posted By jonesal2
Well this was by far the simplest answer, worked...
Well this was by far the simplest answer, worked like a charm :-) Thanks
3,370
Posted By MadeInGermany
For a quick-and-save renaming, I would install...
For a quick-and-save renaming, I would install "mmv"
and run
mmv "*_*_*_*_*_*" "#2_#3_#4_#6"if the reference character is #, like in this man page...
2,207
Posted By junior-helper
Following code utilizes the legendary eval...
Following code utilizes the legendary eval command and should be run in the directory containing the xml files.
#!/bin/bash

#JAN skipped because all files are being kept
FEB=(01 10 11 12)...
Showing results 1 to 18 of 18

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