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
LD10K1(8)																 LD10K1(8)

NAME
ld10k1 - emu10k1(emu10k2) patch loader daemon SYNOPSIS
ld10k1 [option...] DESCRIPTION
This manual page documents briefly the ld10k1 command. This manual page was written for the Debian distribution because the original program does not have a manual page. ld10k1 is a program that... OPTIONS
This program follow the usual GNU command line syntax, with long options starting with two dashes (`-'). -h | --help Prints a short help message -c num | --card num Use card num - ld10k1 will use device with name hw:num. -d | --daemon Run ld10k1 in the background as a daemon. -i file | --pidfile file Print daemon process id to file, default /var/run/ld10k1.pid -l file | --logfile file Log to file. -n | --network Use TCP/IP instead of named Unix sockets for communication. -p name | --pipe_name name lo10k1 will use a local named pipe named name to communication with the linker. Default is /tmp/.ld10k1_port --port portnum Listen on port. Port 20480 is default. -t size | --tram_size size Initialize initial TRAM size to size. size Size is in samples and can be one of: 0 external tram is disabled 1 16 K = 16384 samples 2 32 K = 32768 samples 3 64 K = 65536 samples 4 128 K = 131072 samples 5 256 K = 262144 samples 6 512 K = 524288 samples 7 1024 K = 1048576 samples 8 2048 K = 2097152 samples SEE ALSO
lo10k1(1), dl10k1(8), as10k1(1). AUTHOR
This manual page was written by Mikael Magnusson <mikma@users.sourceforge.net> for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. AUTHOR
Mikael Magnusson. <mikma@users.sourceforge.net> February 18, 2005 LD10K1(8)
All times are GMT -4. The time now is 12:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy