The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script doesn't work as expected when run on cron RoshniMehta Shell Programming and Scripting 2 09-12-2008 07:53 AM
passing variable from bash to perl from bash script arsidh Shell Programming and Scripting 10 06-04-2008 01:25 PM
unzip via bash startup script problems easysnowboards Shell Programming and Scripting 0 05-26-2008 03:25 AM
cygwin bash startup command weirdness (part 1) fabulous2 UNIX for Dummies Questions & Answers 1 05-19-2008 04:25 AM
executing script by cron doesnt give me expected result anchal_khare UNIX for Advanced & Expert Users 1 09-12-2007 09:07 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-01-2008
Crigamorfin Crigamorfin is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 1
Bash script on startup does not respond as expected

Hi,

I have a bash script which I have referenced in the rc.local of my fedora linux OS. However it doesnt respond the same as when run in terminal from fedora.

The bash script has a series of interactive questions that require user input as shown:

#!/bin/bash
echo "Do you want to use fixed IP address?"
read RESPONSE
...

When this script is run from terminal with Fedora i type in "yes" and the response is recorded as expected in varaible.

However the same script on bootup requires me to input the same thing twice on further examination the first input I type is irrelevant?!? Any ideas why it responds differently on bootup?

Cheers
  #2 (permalink)  
Old 10-09-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,886
Sounds like your script is being run twice. The question is: why?
Prefix the echo command with something like:


Code:
pstree -h

Compare the first instance with the second. Maybe you'll learn that rc.local is being invoked twice somehow.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0