LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-31-2009, 08:51 AM   #1
bradvan
Member
 
Registered: Mar 2009
Posts: 367

Rep: Reputation: 61
script doesn't perform the same as task done by hand


Good Morning,

I've written a script to enable console access through the serial port for a RHEL 5 installation. Everything works fine except for changing what systty points to. If I run the script, systty doesn't change. If I do the tasks by hand, it works. Any ideas?

Here is the portion of the script:
Code:
#!/bin/sh
DATE=`/bin/date +'%d%b%y'`
cd /etc/makedev.d
FIL=`grep systty * | cut -d: -f1`
sed -i.${DATE} 's/^\(ls*systty\s*\)0$/\1S0/' ${FIL}
cd /dev
rm systty
./MAKEDEV systty
The file is changed as expected, but systty doesn't point to ttyS0.
 
Old 03-31-2009, 09:32 AM   #2
fpmurphy
Member
 
Registered: Jan 2009
Location: /dev/ph
Distribution: Fedora, Ubuntu, Redhat, Centos
Posts: 299

Rep: Reputation: 62
Add full pathnames to everything and try the script again.
 
Old 03-31-2009, 10:00 AM   #3
bradvan
Member
 
Registered: Mar 2009
Posts: 367

Original Poster
Rep: Reputation: 61
It does. I just didn't type them all in. The file in /etc/makedev.d gets edited and looks fine. But when I run /dev/MAKEDEV systty it doesn't point to ttyS0. Just a tad frustrating.

When I do a diff on the file I see:

diff 01linux-2.6.x 01linux-2.6.x.30Mar09
< l systty ttyS0
---
> l systty tty0

Last edited by bradvan; 03-31-2009 at 11:47 AM.
 
  


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
script Q : how do I force bash to perform the math? kevinyeandel Linux - Newbie 4 02-20-2009 02:35 AM
bash programming question - hand over variables to another script ppr:kut Linux - General 5 02-09-2008 10:00 AM
helping me in a bash script that perform a "select" menus Task adam_blackice Programming 5 09-15-2007 01:09 PM
problems creating a simple bootable cd to perform a simple task czarherr Linux - Software 1 11-11-2004 05:22 AM
writing a script to perform a function on each users mail folder jhill Linux - Newbie 2 08-24-2004 07:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:41 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
Open Source Consulting | Domain Registration