Question about shell scripting in UNIX


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Question about shell scripting in UNIX
# 1  
Old 03-24-2014
Question about shell scripting in UNIX

Unix script coding help?
i am trying to write a code that will display following menu to user:
(A) Add
(B) Subtract
(C) Multiply
(D) Divide
(E) Modulus
(F) Exponentiation
(G) Exit
Then ask user for choice (A-F). After taking users choice ask user for two numbers and
perform chosen operation on those two numbers. The program should keep asking
for choice / numbers unless user chooses ‘G' for exit.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Question regarding for shell scripting.

I tried to run a command which simply generates SSH key with out prompting password. After several trails , got the below command to run the script : ssh-keygen -t rsa -N "" -f id_rsa -N "" tells it to use an empty passphrase (the same as two of the enters in an interactive script) -f... (0 Replies)
Discussion started by: ulaxmi
0 Replies

2. Shell Programming and Scripting

Shell Scripting Question

Hi guys, I am wanting to create a script that will logon to HackThisSite.org and complete Programming Mission 11. You can find a link to this mission here for your reference: www hackthissite org/missions/prog/11/ The following is what I have so far: #!/bin/bash USER="myUsername"... (0 Replies)
Discussion started by: spooke
0 Replies

3. Shell Programming and Scripting

Question in shell scripting

Hello, I have a scenario for which I am trying to write a shell script and I have a question regarding the same. Here's the situation: I am trying to copy a directory which consists of a few sub-directories and .c and .dat extension files say n number of times so that the copied file have... (3 Replies)
Discussion started by: corntown118
3 Replies

4. UNIX for Dummies Questions & Answers

shell scripting question

Testing for the presence/absence of a pattern in a file, using /bin/sh: while read a; do b="${a##*pattern*}"; ; done < file This returns 0 if there's a match. That signal ($?) can then be used outside the loop. However this method reads through the whole file, even if the match... (2 Replies)
Discussion started by: uiop44
2 Replies

5. Shell Programming and Scripting

scp shell scripting question

HI all, I am attempting to use the scp statemet in a shell script that I am writing I need to have the user of the script enter a password at the time of the shell script running.I have the following questions? 1) how do i disable the automatic text echo when the user is entering the... (1 Reply)
Discussion started by: Segwar
1 Replies

6. UNIX for Dummies Questions & Answers

Shell Scripting Question

Hi, I am assaigning the output to the variable outp and when i try to loop thru the variable i see the original content $OUTPUT also in the array outp. I dont want to have the original content in the array outp. Please reply. outp=$(echo $OUTPUT | awk '{FS = "|"}{ for(i=0;i<NF;i++)... (8 Replies)
Discussion started by: vijaykrc
8 Replies

7. Shell Programming and Scripting

basic shell scripting question

If I did indeed grep something out of it, why woudln't $result show nothing? When I do $? , it does show success... What is the proper syntax so that $result shows actual thing it's grepping out? result=`(ssh $host tail -1 /something/somethingelse) | egrep -i "value" >dev/null` #echo... (3 Replies)
Discussion started by: convenientstore
3 Replies

8. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

9. Shell Programming and Scripting

Shell Scripting Question

To anyone who can help greetings, I am a beginner at Unix shell scripting. I need to know how to use the command line tool "itstat". I understand it's application, however I cannot find any additional information. Any assistance will be greatly appreciated. (3 Replies)
Discussion started by: tech2040
3 Replies

10. Shell Programming and Scripting

Shell Scripting Question

To anyone who can help greetings, I am a beginner at Unix shell scripting and am taking a class. The assignment question is as follows: use a command-line tool named "itstat" which will display the resolution of an image file and some other lines of information. It accepts a list of image... (1 Reply)
Discussion started by: tech2040
1 Replies
Login or Register to Ask a Question
setpix(1)						      General Commands Manual							 setpix(1)

Name
       setpix - Set FITS or IRAF image values

Synopsis
       setpix [-vn] file.fts [x_range y_range value] [@valuefile]

Description
       Set  a  specified  pixel  or  range of pixels in a FITS or IRAF image to a specified value. More than one range of pixels and values may be
       specified on one command line. A file of xrange yrange value triplets may be used to set multiple regions at once. The image may  be  over-
       written or a new image created.

Options
       filename
	      Name of IRAF image header file or FITS file. This must be present.

       @coordfile
	      Name of file containing lines of the format
		       xrange  yrange  value  where  xrange  and  yrange are of the format n or n-n or n,n,n or n-n,n-n and value my be integer or
	      floating point.  value will be converted to the type of the image. If a range is 0, the entire row or column specified by the  other
	      non-zero	range  will  be  set to the indicated value. If both ranges are zero, the entire image will be set to the specified value.
	      New in version 2.6.4.

       xrange yrange value
	      Image coordinate x and y ranges and the value to which that region will be set. Either one of these triplets or a file of  triplets,
	      specified by @filename, must be present. xrange and yrange are of the format n or n-n or n,n,n or n-n,n-n and value my be integer or
	      floating point. value will be converted to the type of the image. If a range is 0, the entire row or column specified by	the  other
	      non-zero	range  will  be  set to the indicated value. If both ranges are zero, the entire image will be set to the specified value.
	      Ranges new in version 2.6.4.

       -a <number>
	      Add constant to pixels

       -d <number>
	      Divide pixels by constant

       -i     List each line which is dropped

       -m <number>
	      Multiply pixels by constant

       -n     Write the output to a new file which is named by inserting an e before the file extension. The new file is  always  written  to  the
	      current working directory.

       -s <number>
	      Subtract constant from pixels

       -v     Print more information about the process

Author
       Doug Mink, SAO (dmink@cfa.harvard.edu)

6 July 2001							     WCSTools								 setpix(1)