9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i would like to search a variable for a pattern, without having make any calls to external tools.
i have a code like this:
COUNTPRO2="gine is very bad
vine is pretty good"
case "${COUNTPRO2}" in
*vine*)
factor=${COUNTPRO2}
echo $factor
;;
esac
If the variable contains... (7 Replies)
Discussion started by: SkySmart
7 Replies
2. Shell Programming and Scripting
Hello, I wrote the case on code but it mistakes. I am not sure.
If/elif code:
#!/bin/ksh
you=$LOGNAME
hour=`date | awk '{print substr($4, 1, 2)}'`
print "The time is: $(date)"
if (( hour > 0 && $hour < 12 ))
then
print "Good morning, $you!"
elif (( hour == 12 ))
then (7 Replies)
Discussion started by: Masterpoker
7 Replies
3. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
The assignment is posted below:
Maintain automobile records in a database
Write a shell script to create,... (1 Reply)
Discussion started by: Boltftw
1 Replies
4. Shell Programming and Scripting
Hi
I want to make string substitution ignoring case for search but respecting case for subtitute. Ex changing all occurences of "original" in a file to "substitute":
original becomes substitute
Origninal becomes Substitute
ORIGINAL becomes SUBSTITUTE
I know this a little special but it's not... (1 Reply)
Discussion started by: kmchen
1 Replies
5. Shell Programming and Scripting
Hi all,
I wrote the following simple shell script to perform addition, subtraction, multiplication and division. In the below program, i am not able to exit from the script
Shell Script
-----------
#!/bin/sh
bgcal() {
cal=""
echo "Enter the Option Number: \c"
read cal
if
then... (3 Replies)
Discussion started by: uxpassion
3 Replies
6. UNIX for Dummies Questions & Answers
Hi, I need to change military time to regular time. I know to use case to indicate whether a.m. or p.m. as follows:
case "$hour"
in
0? | 1 ) echo a.m.;;
1 ) echo p.m.;;
* ) echo p.m.;;
esac
My question is how do I add the hour and minute... (2 Replies)
Discussion started by: karp3158
2 Replies
7. Shell Programming and Scripting
Hi there,
Im having some problems with this function, I pass two arguments to the function $1 $2 (Arguments are month and date inputted by the user)
for some reason the case always fails... however in the cases defined below where it shouldnt fail the result is:
if it fails with input... (6 Replies)
Discussion started by: Darklight
6 Replies
8. Shell Programming and Scripting
HELLO ALL,
URGENTLY NEEDED A SCRIPT TO SELECT AND DELETE LOWER AND MIXED CASE RECORDS FROM A COLUMN IN A TABLE.
FOR EXAMPLE : Table name is EMPLOYEE and the column name is CITY
and the CITY column records will be: Newyork
washington
... (1 Reply)
Discussion started by: abhilash mn
1 Replies
9. UNIX for Dummies Questions & Answers
How can convert a Lower case variable value to an upper case in the kron shell script. (3 Replies)
Discussion started by: dchalavadi
3 Replies