Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Are the brains of the UNIXoid working correctly? Post 303031445 by Corona688 on Thursday 28th of February 2019 10:46:42 AM
Old 02-28-2019
Code:
T=0 ; for X in {2..100} ; do ((T+=X)) ; done

Loses at code golf, but wins in a world where code must be read, understood, and maintained.

More seriously, Haskell won't replace shell, they've got different jobs. Haskell's real opportunities are perl and python, two omnipresent languages ill-equipped for formal math/logic but often pressed into service with the assistance bolt-on modules. This works but the syntax of calling modules for something you'd expect a builtin to do is inevitably ugly. Something with more orthogonal data structures could do a lot more with a lot less kludge. What can Haskell's data structures do?
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script not working correctly

I have a simple script that I want to run every 30 minutes but only when I execute it. I don't want it to be a crontab job. so i have for example date ls -l who sleep 1800 The first time it executes correctly but after the first time it nevers execute back again. It should execute after... (2 Replies)
Discussion started by: elchalateco
2 Replies

2. Shell Programming and Scripting

if not working correctly

Anyone have an idea why this if statement does not work correctly? "test2.sh" 18 lines, 386 characters #!/usr/bin/sh WARNING=80 CRITICAL=95 check_it() { if ] || ];then echo "YES ] || ]" else echo "NO ] || ]" fi } check_it 80.1 check_it 81.1 (3 Replies)
Discussion started by: 2dumb
3 Replies

3. Shell Programming and Scripting

Variable not working correctly.

Hi, I have a script where I am trying to set a local variable using the following, MYVAR="$NAME"_"$NAME2".txt where say, NAME = one NAME2 = two so I want the output one_two.txt but what I am getting is, two.txt basically the $NAME2 is overwriting, what am I doing wrong? ... (3 Replies)
Discussion started by: walsh_j
3 Replies

4. Programming

Shell Implementation not working correctly

//save in/out int tmpin = dup(0); int tmpout = dup(1); //set initial input int fdin; if(_inputFile) { fdin = open(_inputFile, O_RDONLY | O_CREAT, S_IREAD | S_IWRITE); } else { //use default input fdin = dup(tmpin); } int ret; int fdout; for(int i = 0; i... (14 Replies)
Discussion started by: AirBronto
14 Replies

5. UNIX for Dummies Questions & Answers

grep -A switch not working correctly with -m

egrep -A 7 -m 2 -h 'Date:|Time:' *.html this is showing only 2 line after the context of the 2nd found match. Is this a bug in grep? egrep -A 7 -m 2 -h 'Time:' *.html - this works correctly (2 Replies)
Discussion started by: zer0
2 Replies

6. Shell Programming and Scripting

Find cmd not working correctly in script

I am trying to copy 2 types of files so I can archive them. I tested with a set of commands: touch -t $(date -d "-60 day" +%Y%m%d) WORKDIR/REF find TARGETDIR/ -type f -maxdepth 1 -iname \*.out\* -or -iname \*.log\* ! -newer WORKDIR/REF -exec ls -l {} \; This correctly lists any files in the... (2 Replies)
Discussion started by: prismtx
2 Replies

7. Shell Programming and Scripting

rsync is not correctly working

We are using Red Hat linux system. I am transferring my rman backup files to another server. Here is the command i am using to transfer the files. /usr/bin/rsync -avpP --delete /xyz/xyz/ 99.99.999.99::db110bkp Here is the rsync version. >rsync --version rsync version 3.0.6 ... (1 Reply)
Discussion started by: govindts
1 Replies

8. UNIX for Dummies Questions & Answers

Grep Regexp not working correctly

Consider the following code: grep -o -e '^STEAM_::\d+$' workfile3.tmp A sample format of a valid string for the regexp would be: STEAM_0:1:12345678 Here is an example line from the workfile3.tmp file: 465:L 01/02/2012 - 00:05:33: "Spartan1-1-7<8><STEAM_0:1:47539638><>" connected No... (2 Replies)
Discussion started by: spinner0205
2 Replies

9. Shell Programming and Scripting

awk not working correctly

Hi I am attempting to right a script which will read a table and extract specfic information. LASTFAILEDJOB=/usr/openv/netbackup/scripts/GB-LDN/Junaid/temp_files/lastfailedjob cat /usr/openv/netbackup/scripts/GB-LDN/Junaid/temp_files/lastfailedjob 237308646 If i run the following... (5 Replies)
Discussion started by: Junes
5 Replies

10. UNIX for Dummies Questions & Answers

vnc No Longer Working Correctly

Hello All, Yesterday, all day, I was using x11vnc and vncviewer to connect to a server. But today for some reason it is not working. I don't remember changing any settings or anything like that, but because it stopped working correctly I guess something has...? I'm issuing the exact same... (0 Replies)
Discussion started by: mrm5102
0 Replies
GTK2HSC2HS(1)							    C->Haskell							     GTK2HSC2HS(1)

NAME
gtk2hsC2hs - C->Haskell Interface Generator SYNOPSIS
gtk2hsC2hs [OPTIONS]... [ header-file ] binding-file DESCRIPTION
This manual page briefly describes the gtk2hsC2hs command. It's a modified version of the c2hs(1) command, which is a helper program nec- essary to build the Gtk2Hs suite of libraries. OPTIONS
The programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options are included below. For a complete description, see the other documentation. gtk2hsC2hs accepts the following options: -h, -?, --help brief help -v, --version show version information -c CPP, --cpp=CPP use executable CPP to invoke C preprocessor -C CPPOPTS, --cppopts=CPPOPTS pass CPPOPTS to the C preprocessor -o FILE, --output=FILE output result to FILE (should end in .hs) -t PATH, --output-dir=PATH place generated files in PATH -p PLATFORM, --platform=PLATFORM platform to use for cross compilation -k, --keep keep pre-processed C header -l NAME, --lock=NAME wrap each foreign call with the function NAME -d TYPE, --dump=TYPE dump internal information (for debugging), where TYPE is one of: o trace trace compiler phases o genbind trace binding generation o ctrav trace C declaration traversal o chs dump the binding file (adds .dump to the name) header-file is the header file belonging to the marshalled library. It must end with suffix .h. binding-file is the corresponding Haskell binding file, which must end with suffix .chs. PLATFORM The platform name can be one of: x86_64-linux. i686-linux. m68k-palmos. This allows for cross-compilation, assuming the rest of your toolchain supports that. The default is the current host platform. The most useful of these options is probably --cppopts (or -C). If the C header file needs any special options (like -D or -I) to go through the C pre-processor, here is the place to pass them. EXAMPLES
When used directly, gtk2hsC2hs is usually called as: gtk2hsC2hs lib.h Lib.chs where lib.h is the header file and Lib.chs the Haskell binding module, which define the C- and Haskell-side interface, respectively. If no errors occur, the result is a pure Haskell module Lib.hs, which implements the Haskell API of the library. A more advanced call may look like this: gtk2hsC2hs --cppopts=-I/some/obscure/dir --cppopts=-DEXTRA lib.h Lib.chs Often, lib.h will not be in the current directory, but in one of the header file directories. Apart from the current directory, C->Haskell looks in two places for the header: first, in the standard include directory of the used system, this is usually /usr/include and /usr/local/include; and second, it will look in every directory that is mentioned in a -IDIR option passed to the pre-processor via --cppopts. CAVEATS
If you have more than one option that you want to give to the pre-processor, use multiple --cppopts= flags. BUGS
Please report bugs and feature requests in the Gtk2Hs trac http://hackage.haskell.org/trac/gtk2hs/ or to the Gtk2Hs mailing list gtk2hs-devel@lists.sourceforge.net COPYRIGHT
C->Haskell Compiler, version 0.13.4 (gtk2hs branch) Copyright (c) [1999..2004] Manuel M T Chakravarty <chak@cse.unsw.edu.au> AUTHOR
This page was addapted from the c2hs(1) manpage, by Marco Tulio Gontijo e Silva <marcot@debian.org> for the Debian GNU/Linux system (but may be used by others), which was mainly assembled from the original documentation of c2hs. The c2hs(1) was written by Michael Weber <michael.weber@post.rwth-aachen.de> for the Debian GNU/Linux system (but may be used by others). Version 0.13.4 (gtk2hs branch) November 2004 GTK2HSC2HS(1)
All times are GMT -4. The time now is 03:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy