Output of Shell Script Doesn't Skip to next line


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Output of Shell Script Doesn't Skip to next line
# 1  
Old 02-24-2010
Output of Shell Script Doesn't Skip to next line

Hi.
This is what I coded:
Code:
tput cup $1 $2  # place cursor on row and col
tput clear # clear the screen
bold=`tput smso` #set stand-out mode - bold
offbold=`tput rmso` # reset  screen - turn bold off
echo $bold  # turn bold on
tput cup 10 20; echo "Type Last Name:" #bold caption
tput cup 12 20; echo "Type First Name:" #bold caption
echo $offbold  # turn bold off
tput cup 10 41; echo read lastname # enter last name
tput cup 12 41; echo read firstname # enter firstname

this is my output: Type Last Name: LAST

Type First Name:
How do I get to the Type First Name line?
What is missing, if anything, from my code?
Thanks In Advance
P.S. My email kinda moves the output example around.
# 2  
Old 02-25-2010
I interchanged some lines in your code. Now try and give your feedbacks.


Code:
tput cup $1 $2  # place cursor on row and col
tput clear # clear the screen
bold=`tput smso` #set stand-out mode - bold
offbold=`tput rmso` # reset  screen - turn bold off
echo $bold  # turn bold on
tput cup 10 20; echo "Type Last Name:" #bold caption
tput cup 10 41; read lastname # enter last name
tput cup 12 20; echo "Type First Name:" #bold caption
tput cup 12 41; read firstname # enter firstname
echo $offbold  # turn bold off


output:

Type Last Name:      vennila

Type First Name:     nila


Last edited by Nila; 02-25-2010 at 12:33 AM..
# 3  
Old 02-25-2010
Hello Ccccc,

In your script,you simply remove the echo before read command 9th and 10th line.Because,read is a command used to get the name from user.If you use echo,then the string read lastname and read firstname will be printed.

I just copied your code and I removed the echo before read statement and it worked perfectly.
# 4  
Old 02-25-2010
Output of Shell Script Doesn't Skip to next line‏

To Nila:
Thank you very much.
Hey, & I understand the changes.
Ccccc

---------- Post updated at 01:01 PM ---------- Previous update was at 12:59 PM ----------

Vivekraj thank tons for the insightful explanation.
Gratefully,
Cccccc
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

The shell script doesn't get arguments, but parse them

Hello, I have a simple shell script, which starts from crontab like this: 00 03 * * 2-6 /export/applications/dte/sh/fwmarg.sh > /export/applications/dte/data/cron_log/fwmarg.cronlog.`date +\%m.\%d` 2>&1 The script doesn't get any argument. But inside it I see the line ... (10 Replies)
Discussion started by: digioleg54
10 Replies

2. HP-UX

Su to another user from root doesn't work within shell script

Hello I have a shell script that is run as root. Script rins ok until the point where it have to switch to user "mqm" to run other commands. It just hangs at the point of this line in the script su - mqm -c "dspmq" I ran the same commands at the terminal and they run fine. Any thoughts. (6 Replies)
Discussion started by: mo12
6 Replies

3. HP-UX

Find command doesn't return in shell script.

Hi All, I am using below snippet to search for a string (read from a file 'searchstring.out') in all locations (/) and then iterate over the files found to write the locations and the respective owner to an output file. However, this doesn't work as I believe the find command doesn't exit's... (11 Replies)
Discussion started by: Vipin Batra
11 Replies

4. Shell Programming and Scripting

How to skip the first line of the script in shell using python?

How to skip first line of the script in shell, using python. (3 Replies)
Discussion started by: KarthikPS
3 Replies

5. Shell Programming and Scripting

useless line feeds in ldapsearch output. Howto remove with shell script?

Hi $ cat ad.sh ldapsearorg -x -LLL -h sb1131z.testbadbigcorp.org -D "CN=ADMINZZ,OU=AdminRoles,DC=testbadbigcorp,DC=org" -w "UT3w4f57lll--4...4" -b "OU=Test,DC=testbadbigcorp,DC=org" "(&(&(&(&(objectCategory=person)(objectClass=user)(lockoutTime:1.2.840.113556.1.4.804:=4294967295)))))" dn$... (3 Replies)
Discussion started by: slashdotweenie
3 Replies

6. Shell Programming and Scripting

Unix Shell scripting -How to skip User Standard input section from another script

All, problem Description: For example: I have two shell scripts(executables). let name it as script1 and script2.I'm trying to execute script1 from script2. while executing script2, script1 is asking for manual input(input from keyboard). Now i need to know how I can skip this user input... (3 Replies)
Discussion started by: techie99
3 Replies

7. Shell Programming and Scripting

shell script, echo doesn't work

#!/bin/sh something(){ echo "Inside something" echo $1 $2 } val=$(something "Hello " "world") Output expected: Inside somethingHello world But it's not echoing. (4 Replies)
Discussion started by: cola
4 Replies

8. Shell Programming and Scripting

script doesn´t read last line

hi, i have a file with 5 lines, like this: 068|3|20080331|P|21090|5|0|0|0|0|0|0|0 068|3|20080331|P| |6|0|0|0|0|0|0|0 068|3|20080331|P|21040|7|0|233|105|161|6157|6656|101 068|3|20080331|P| |T|188842|33996|14543|3226|7193|247800|298 068|3|20080331|T|... (2 Replies)
Discussion started by: DebianJ
2 Replies

9. Shell Programming and Scripting

Shell script doesn't get executed using crontab

I have the following crontab entry to run a shell script for every 30 minutes of every day: 30 * * * * $HOME/main.sh > $HOME/main.log 2>$HOME/error.log after I created the crontab file I have also done: $crontab my_crontab I also check to make sure it exists, by using the following... (11 Replies)
Discussion started by: radhika
11 Replies

10. Shell Programming and Scripting

command line work script doesn't

Hello, I'm stuck and confused as to why when I execute things form the command line it works but when in a script it doesn't. My script: ### creating a lock on the console touch /var/run/console.lock chmod 600 /var/run/console.lock echo "$User" >>... (2 Replies)
Discussion started by: larry
2 Replies
Login or Register to Ask a Question