Sponsored Content
Homework and Emergencies Homework & Coursework Questions Help with bash shell scripting Post 302513199 by DGPickett on Tuesday 12th of April 2011 02:41:56 PM
Old 04-12-2011
But then it might not be ksh portable!
Code:
$ echo "(( 1 + 2 ))"
(( 1 + 2 ))
$ echo (( 1 + 2 ))  
ksh: syntax error: `((' unexpected
$ echo $(( 1 + 2 ))
3
$

Integer limited 31 bit signed, not much error checking:
Code:
$ z=1;while [ 1 ]
do
echo $z
z=$(( $z + $z ))
done 2>&1|pg
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
32768
65536
131072
262144
524288
1048576
2097152
4194304
8388608
16777216
33554432
67108864
134217728
268435456
536870912
1073741824
-2147483648
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

bash shell scripting

Hi, i am new to UNIX. I have couple of basic questions. 1. Is the syntax for BASH shell programming same in the LINUX and SUN SOLARIS operating systems? 2. I have to work on BASH shell programming in SUN SOLARIS operating system. I am going through the documentation from the following... (4 Replies)
Discussion started by: azazalis
4 Replies

2. Shell Programming and Scripting

Help!! bash shell scripting..

Can any1 please help me... i'm really lost in using bash shell scripting... and i got to hand this up on monday... please anyone teach me how to do this assignment... Please use basic things because i just learn the program only... thanks ... (1 Reply)
Discussion started by: Fr0z3n999
1 Replies

3. Shell Programming and Scripting

Bash shell Scripting help

wwww wwwwwwww wwwwwwwwwwwww (0 Replies)
Discussion started by: keyvan
0 Replies

4. Shell Programming and Scripting

how to use regular expression in Bash Shell Scripting

Hi, Actually i have written one test.sh (shell program) in bash. Here i have a variables $a which stored the value package1. Now I want to write a regular expression inside the if command that "if $a variable contains letter p in the begining of the value package1 then it is coming true.... (5 Replies)
Discussion started by: sunitachoudhury
5 Replies

5. Shell Programming and Scripting

File handling with bash shell scripting

Hi all, Can anyone guide to get tricks for file handling in bash shell? Thanks in advance. Thanks Deepak (2 Replies)
Discussion started by: naw_deepak
2 Replies

6. Shell Programming and Scripting

bash shell scripting error need help urgently

#! /bin/sh abcd = "Hello world" if then echo $abcd fi i got error message that line3 : abcd: command not found line5 : [0: command not found line5 : [1: command not found i have no idea why i got this message. Can some one help me ??? (6 Replies)
Discussion started by: bonosungho
6 Replies

7. UNIX for Dummies Questions & Answers

File handling in bash shell scripting

i am new to shell scripting and stuck at one place in my program. i am reading data from one structured file and extracting some data from particular lines and then writing into the output file. In that reading input file line by line from while loop. while read line do rectype=line... (7 Replies)
Discussion started by: reeta_shri
7 Replies

8. Shell Programming and Scripting

Bash shell scripting doubt

Hello All, I am setting up a cron job, where i am calling a shell script to make few builds. I got struck at a point, need some expert inputs to proceed further. The script is categorized in 5 parts and in the last part while building software it asks for few questions like:- 1. Build mode... (4 Replies)
Discussion started by: sahil_jammu
4 Replies

9. UNIX for Dummies Questions & Answers

BASH Shell Scripting: If, Then Statement

I'm having trouble trying to create a BASH shell script. I want the user to input a command "cat file_name.c" and then the shell script will delete all comments "/* */" from file_name.c else exit. So far I have this: #!/bin/bash read "cat file" // User will input command cat... (7 Replies)
Discussion started by: inkjoy00
7 Replies

10. UNIX for Dummies Questions & Answers

Learn bash shell scripting

I do not know shell scripting. But at work place, I have got an in and out shell scripting task. I just need to understand a very big script. Is there any tool in which I can place the script and it can tell me the meaning of the whole script? (3 Replies)
Discussion started by: lg123
3 Replies
CONSTANTS(5)							LAM FORTRAN LIBRARY						      CONSTANTS(5)

NAME
CONSTANTS - constants for LAM Fortran programming DESCRIPTION
The following table describes the values appropriate to various constants used in LAM. It also describes the meaning of the constants and lists the cpp(1) header files in which the constants can be found. To use these files, the Fortran source files will need to be passed through cpp(1) before they are given to the Fortran compiler. Some compiler drivers will run cpp(1) if the source file suffix is .F. In lieu of cpp(1), the constants can be copied to parameter statements in the Fortran source files. CONSTANT VALUE DESCRIPTION FILE Network Constants: LOCAL -2147483647 local node NET.h MAXNMSGLEN 8192 maximum length of one message packet NET.h NHDSIZE 8 maximum size in words of ndata NET.h argument NOTNODEID -2147483648 error occurred in IGNDID(2) NET.h NOTNODETYPE -2147483648 error occurred in IGRTP(2) NET.h Node Types: NTCAST 2 multicast definition NET.h NTWASTE 4 not fully used/wasted NET.h NTDISK 8 node with attached disk NET.h NTTUBE 16 node with attached video unit NET.h NTJONES 32 node is a neighbour NET.h NTBOOT 64 neighbour node to boot NET.h NTALL 127 matches any type NET.h Message Flags: NOBUF 16 turn off buffering NET.h NREEL 1024 multireel NET.h DRAWDATA 65536 ndata representation will not be NET.h changed DINT4DATA 131072 ndata holds 8 32-bit integer NET.h DFLT4DATA 262144 ndata holds 8 single precision reals NET.h DFLT8DATA 524288 ndata holds 4 double precision reals NET.h DRAWMSG 1048576 nmsg representation will not be NET.h changed DINT4MSG 2097152 nmsg holds integers NET.h DFLT4MSG 4194304 nmsg holds single precision reals NET.h DFLT8MSG 8388608 nmsg holds double precision reals NET.h Reserved Cast Identifiers: HOST2ALL -2147483646 multicast from origin to all nodes NET.h HOST2COMP -2147483642 multicast from origin to compute nodes NET.h File Flags: O_RDONLY 0 open for reading only FREQ.h O_WRONLY 1 open for writing only FREQ.h O_RDWR 2 open for reading and writing FREQ.h O_APPEND 8 append on each write FREQ.h O_CREAT 512 create file if it does not exist FREQ.h O_TRUNC 1024 truncate length to 0 FREQ.h O_EXCL 2048 error if create and file exists FREQ.h O_SYNC 8192 update file data and file status FREQ.h before writing O_LOCK 65536 lock file descriptor active FREQ.h O_REUSE 131072 reuse existing file descriptor FREQ.h O_1WAY 4194304 do not acknowledge writes FREQ.h Process Runtime Flags: RTF_WAIT 16 child sends a message to NET.h parent when it exits RTF_TRACE 256 enable process tracing NET.h LAM 7.1.4 July, 2007 CONSTANTS(5)
All times are GMT -4. The time now is 11:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy