have written the below code to check whether the string received from user is a file name or dir using case statement, but its going into default case*).
can someone help me please..
Last edited by vbe; 02-23-2016 at 07:41 AM..
Reason: code tags please
Hi,
I'm trying to write a shell script that has a menu and then dependant on the selection, will automate some samba file transfer.
The problem is when I run the code without the case statement it runs fine. but when I put the case statement in the only way I can get the code to run is to... (6 Replies)
Hi All,
this small script is written to recognize user input character.. it is in small case .. upeer case or is a number... but when i input first capital letter say A.. it always gives small character.... what is the problem.
#!/bin/bash
echo "Enter the character"
read a
case $a in
)... (2 Replies)
In a case statement like below :
case $rental in
"car") echo "For $rental Rs.20 per k/m";;
"van") echo "For $rental Rs.10 per k/m";;
"jeep") echo "For $rental Rs.5 per k/m";;
"bicycle") echo "For $rental 20 paisa per k/m";;
*) echo "Sorry, I can not gat a $rental for you";;... (4 Replies)
Hi,
I have a script like below :
#!/bin/ksh
echo "Do you want to export all docs ?"
read alld
echo "Do you want to export template or report only "
read temr
case && ]
#arguments
;;
case && ]
#arguments
;;
case && ]
#arguments
;; (4 Replies)
i want to get user input like this
please tell which option to chose
1. mango 2. tango 3. rango
if user chooses mango
then it should execute a set of statements and again ask like this
what do you want to do
1.add 2.subtract 3.exit
when i choose exit it should goto my previous menu... (4 Replies)
Hi,
I am New to Unix Shell Scripting basically, i need some help in achieving a case statement in Shell script to call recursively That is if case having like 1 2 3 4 options , if user inputs 1 and gets executed case should ask for options again but user should not input the same input value 1,... (7 Replies)
Hi Gurus,
I have a very weird requirement and have no clue to resolve the issue. please help me get out this difficulty
below two tables, table1 contains the column name. D means this column used for the rule. for example: rule 0 is all columns have value, rule1 is col3 and col7 have no value.... (2 Replies)
Foe example we have three environments int,qa and prod.Each environment has some number of servers.
int=Server1,Server2,Server3
qa=Server4,Server5,Server6
prod=Server7,Server8,Server9
echo "Enter the Environment i.e int,qa,prod"
read env
case $env in
int)
## Need command where all the... (9 Replies)
Linux System having all Perl, Python, PHP (and Ruby) installed
From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file
eg
eg
a Shell script run in a case statement call to run a php file, also Perl or/and Python file???
Like
#!/usr/bin/bash
....
....
case $INPUT_STRING... (1 Reply)