10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
Hi ,
I have the file where i have to search for the pattern. The pattern may be lower case or upper case or camel case. Basically I want to ignore while searching the pattern in awk.
awk '/error|warning/exception/' filename
Please help me (3 Replies)
Discussion started by: arukuku
3 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 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
5. 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
6. Shell Programming and Scripting
Hi, I have a variable $Ctrcd which contains country names in upper case and i want to convert them into lower case. I have tried so many solutions from already existing threads but couldn't get the correct one.
Can anybody help me with this.....
Thanks a lot.. (2 Replies)
Discussion started by: manmeet
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
Please bare with me as task is very detailed and I'm extremely new to Awk/sed. Keep in mind I'm running windows so I'm using a dos prompt
The attachment is a server report that I'm trying to manipulate with little success. For each server, I need to take the most recent information about them... (2 Replies)
Discussion started by: Blivo
2 Replies
9. Shell Programming and Scripting
i need to use a case statement to do something when the user enters nothing at the prompt.
i know about the if statement and that isnt' what i'm interested in using for this. i want to use case.
heres the scenerio. a program asks a user for an input. i want to use a case statement to... (1 Reply)
Discussion started by: Terrible
1 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I've searched this site and not found this already, so if I missed on my search, sorry.
I need to pass in a variable to a script, where the first three characters of that variable represent a calendar quarter, and the last 2 characters are the year. I.E. Q0105 for Q1, Q0205 for Q2, and... (3 Replies)
Discussion started by: Rediranch
3 Replies