LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-26-2012, 12:33 AM   #1
doomaway
LQ Newbie
 
Registered: Apr 2012
Posts: 12

Rep: Reputation: Disabled
Smile shell question


hi all afternoon beautiful!
i have a shell script
Quote:
#!/bin/bash
tail ./temp.t

echo "SUCCESSFUL"
how can i press some keys to stop tail command then run echo command!

thanks in advance!
 
Old 12-26-2012, 01:24 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Put a "read" command between the two commands. It will wait until you hit enter to continue, e.g.:

[CODE}
echo "press enter to continue"
read

echo "You pressed enter."
[/CODE]
 
Old 12-26-2012, 04:09 AM   #3
doomaway
LQ Newbie
 
Registered: Apr 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by btmiller View Post
Put a "read" command between the two commands. It will wait until you hit enter to continue, e.g.:

[CODE}
echo "press enter to continue"
read

echo "You pressed enter."
[/CODE]
hi btmiller
thanks first

sorry for my mistake this is my script
Quote:
#!/bin/bash
tail -f ./temp.t

echo "SUCCESSFUL"

and i fix my problem

i can change my script like this
Quote:
trap "echo ctrl c; exit 1" INT
tail -f 1.sh
echo very thanks!
sorry for my poor chinese_english
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell question KMcKee Linux - Newbie 4 10-23-2012 07:34 PM
A question about shell (bash shell) thomas2004ch Linux - Newbie 4 08-27-2009 03:09 AM
shell question Rob Pijpers Linux - Newbie 4 08-16-2006 03:12 AM
Shell question satimis Linux - General 5 08-11-2005 10:57 AM
question about shell jaylee Linux - General 8 06-22-2003 10:42 PM


All times are GMT -5. The time now is 06:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration