I am trying to calculate the maximum number from four numbers input by the user. I have the following code, but it does not work. It says there's an error with the last line "done". Any help would be appreciated.
Hello there, I am posting to seek help with a KSH script,
I am making a simple calculation program where the user can enter as many numbers as they like, I am getting their input using the read command, however I am not sure how to repeat doing this and storing the input in to new variables until the user wants the program to calculate.
Here is what I have so far
Code:
#!/bin/ksh
I'm trying to get this script to work i'm close but there's some wrong any help is welcome.
while writing a script m not able to convert string into a number therefore it is not picking the write if condition
pls help
Code:
#!/bin/sh
echo "this game is about selecting number and getting lucky"
echo " the number are 1 2 3 4 5 and 0 to exit"
read $a1
if [ "$a1" = 1 ]; then
echo "NUMBER IS NOT CO
Hi guys...was trying to use while loop and a sentry to prompt user input again if an invalid option was entered...but somehow I got a "while" unmatched error...The code is as below:
Code:
#!/system/bin/sh
finsh=0
while [ $finish -ne 0 ]
do
echo "Please select an option: "
echo "1. One" echo "2. Two"
echo "3. Three"
echo "4.
Hello,
I've been working with C trying to get factorials which I've successfully accomplished but my code needs to output an error message when inputting negative numbers, unfortunately my code outputs an error when using 1 and 0.
This is what my code looks like (keep in mind I'm a beginner user so my code is simple).
#include <stdio.h>
int main()
Hi,
I'm having some trouble with using "case...esac" in Bash.
I've googled it and am stuggling to understand the syntax and how to do certain things.
Firstly, I want to be able to choose a case based on a variable number
For example, I have in my code a place where a user can enter a number using read.
Code:
read SEL
Then I want to use a case to decide what should be don
Hi all, I am reading through the Non-Programmer's Tutorial and I would like to make a program with Python in which is similar to the one in the example.
The following code will split the infile into multiple files. However, I need it to insert the same first 3 lines from the original input file into each splitted file. How do I modify my script below to do so:
Code:
print -n "Enter file name to split?