LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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-25-2012, 11:33 PM   #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, 12:24 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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, 03: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



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 06:34 PM
A question about shell (bash shell) thomas2004ch Linux - Newbie 4 08-27-2009 02:09 AM
shell question Rob Pijpers Linux - Newbie 4 08-16-2006 02:12 AM
Shell question satimis Linux - General 5 08-11-2005 09:57 AM
question about shell jaylee Linux - General 8 06-22-2003 09:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:27 PM.

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
Open Source Consulting | Domain Registration