Why won't sripts work in REDHAT?

This is a discussion on Why won't sripts work in REDHAT? within the Linux Administration forums, part of the Linux Forums category; I welcome any ideas and appreciate your help. Please, if you are going to tell me to RTFM, don't ...


Go Back   Usenet Forums > Linux Forums > Linux Administration

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-30-2003
Joe Wilk
 
Posts: n/a
Default Why won't sripts work in REDHAT?

I welcome any ideas and appreciate your help. Please, if you are going
to tell me to RTFM, don't waste your time or mine and leave me alone.
The RTFM command is circuitous, incomplete, and don't work for me (I
read English nicely, and complete sentences go much further).

I simply want to copy folders and files from a CD drive to the redhat
system. Each command I have entered in the script does what I want
when evetered in the terminal. The BASH command resides in /bin/, and
I have set permissions on the script to everything from 700 to 777. I
am logged in as root.

The first command in my sript is: #!/bin/bash

When run, the hard drive shows activity, the CD ROM shows activity;
the system just doesn't actually DO anything (such as moving files
from CD-already mounted-to the HD).

Who am I kidding? I am going to get flamed anyway. :-)

Thanks again,

CC
Reply With Quote
  #2 (permalink)  
Old 12-30-2003
Bit Twister
 
Posts: n/a
Default Re: Why won't sripts work in REDHAT?

On 30 Dec 2003 07:10:45 -0800, Joe Wilk wrote:
> I welcome any ideas and appreciate your help. Please, if you are going
> to tell me to RTFM, don't waste your time or mine and leave me alone.
> The RTFM command is circuitous, incomplete, and don't work for me (I
> read English nicely, and complete sentences go much further).
>
> I simply want to copy folders and files from a CD drive to the redhat
> system. Each command I have entered in the script does what I want
> when evetered in the terminal. The BASH command resides in /bin/, and
> I have set permissions on the script to everything from 700 to 777. I
> am logged in as root.


chmod 755 would be better than 777

>
> The first command in my sript is: #!/bin/bash
>
> When run, the hard drive shows activity, the CD ROM shows activity;
> the system just doesn't actually DO anything (such as moving files
> from CD-already mounted-to the HD).
>
> Who am I kidding? I am going to get flamed anyway. :-)


Yes, Please read http://www.catb.org/~esr/faqs/smart-questions.html

put this line after the #!/bin/bash
set -vx # enable debugging information
and at the bottom
set - # disable debugging information


Do your thing and see if you can find your problem. If you have to
come back here, we need you to cut/paste commands and results seen on
screen to see what is going on.

Reply With Quote
  #3 (permalink)  
Old 12-30-2003
Keith Keller
 
Posts: n/a
Default Re: Why won't sripts work in REDHAT?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2003-12-30, Joe Wilk <cagey_cretin@netzero.com> wrote:
> I welcome any ideas and appreciate your help. Please, if you are going
> to tell me to RTFM, don't waste your time or mine and leave me alone.


Ah, a challenge!

The RTFM edict is perfectly appropriate if the answer to your question
is in the FM. If you're going to use linux, you'll probably either need
to learn how to R the FM for yourself or pay someone to do it for you.
Posting here every time you have a problem with "Please don't tell me to
RTFM" is bound to get old quickly for the people who would be willing to
help.

Of course, in this case the FM would be man bash, which isn't always
helpful. :) But next time maybe the FM would be helpful, so don't rule
it out automatically.

> I simply want to copy folders and files from a CD drive to the redhat
> system. Each command I have entered in the script does what I want
> when evetered in the terminal.


If it's short why not post it? In addition you might post how you're
executing the script from the command line.

> The BASH command resides in /bin/, and
> I have set permissions on the script to everything from 700 to 777. I
> am logged in as root.


You don't seem to understand permissions, then; it's unsafe to make a
root-owned script world-writable. If you're running the script as root
700 would work fine, so clearly something else is wrong. At this point
I doubt anyone who can't read minds would be able to tell you what's
wrong without more information.

- --keith

- --
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/8dP7hVcNCxZ5ID8RAnXeAJwLU/DjGuil27GqgTeUKYg66mXXCgCgmb/2
02WrncnkHdUM/tqqhKK5do8=
=oLdt
-----END PGP SIGNATURE-----
Reply With Quote
  #4 (permalink)  
Old 12-30-2003
Joe Wilk
 
Posts: n/a
Default Re: Why won't sripts work in REDHAT?

Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> wrote in message news:<c6kssb.flf.ln@goaway.wombat.san-francisco.ca.us>...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 2003-12-30, Joe Wilk <cagey_cretin@netzero.com> wrote:
> > I welcome any ideas and appreciate your help. Please, if you are going
> > to tell me to RTFM, don't waste your time or mine and leave me alone.

>
> Ah, a challenge!
>
> The RTFM edict is perfectly appropriate if the answer to your question
> is in the FM. If you're going to use linux, you'll probably either need
> to learn how to R the FM for yourself or pay someone to do it for you.
> Posting here every time you have a problem with "Please don't tell me to
> RTFM" is bound to get old quickly for the people who would be willing to
> help.
>
> Of course, in this case the FM would be man bash, which isn't always
> helpful. :) But next time maybe the FM would be helpful, so don't rule
> it out automatically.
>
> > I simply want to copy folders and files from a CD drive to the redhat
> > system. Each command I have entered in the script does what I want
> > when evetered in the terminal.

>
> If it's short why not post it? In addition you might post how you're
> executing the script from the command line.
>
> > The BASH command resides in /bin/, and
> > I have set permissions on the script to everything from 700 to 777. I
> > am logged in as root.

>
> You don't seem to understand permissions, then; it's unsafe to make a
> root-owned script world-writable. If you're running the script as root
> 700 would work fine, so clearly something else is wrong. At this point
> I doubt anyone who can't read minds would be able to tell you what's
> wrong without more information.
>
> - --keith
>
> - --
> kkeller-usenet@wombat.san-francisco.ca.us
> (try just my userid to email me)
> AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
>
> iD8DBQE/8dP7hVcNCxZ5ID8RAnXeAJwLU/DjGuil27GqgTeUKYg66mXXCgCgmb/2
> 02WrncnkHdUM/tqqhKK5do8=
> =oLdt
> -----END PGP SIGNATURE-----


Thank you Keith,

My problem was that I took the manual literaly. It says that 'any text
editor can be used to create shell scripts". What it does NOT say is
that when you open it up in VI you may find extra charecters added
courtesy of the editor you use.

Foolishly, I used the gedit editor that came with redhat 9. When I
realized that I had been punk'd, I edited the junk out of the file and
ran it. Everything good.

To other newbies: Beware, not all text is wysiwyg (what you see is
what you get). Jeeezus!!!

CC
Reply With Quote
  #5 (permalink)  
Old 12-30-2003
Joe Wilk
 
Posts: n/a
Default Re: Why won't sripts work in REDHAT?

Thank you BitTwister.

CC
Reply With Quote
  #6 (permalink)  
Old 12-31-2003
Joe Wilk
 
Posts: n/a
Default Re: Why won't sripts work in REDHAT?

Man, I really feel like an idiot! :-P
Reply With Quote
  #7 (permalink)  
Old 01-01-2004
Stuart Fuller
 
Posts: n/a
Default Re: Why won't sripts work in REDHAT?

Joe Wilk wrote:
>
> Foolishly, I used the gedit editor that came with redhat 9. When I
> realized that I had been punk'd, I edited the junk out of the file and
> ran it. Everything good.
>
> To other newbies: Beware, not all text is wysiwyg (what you see is
> what you get). Jeeezus!!!


I'd be very interested in seeing what "junk" was added to the tail of the
file.

--

Stu
Reply With Quote
  #8 (permalink)  
Old 01-20-2004
Andy Smith
 
Posts: n/a
Default Re: Why won't sripts work in REDHAT?

I would imagine the "junk" was a non *nix-ish carriage return/line feed
combination. I have been bit by that one myself when moving text files
between Windows and Linux.

--------------------------
Andy Smith, MCP
wasmith32@earthlink.net
--------------------------



Stuart Fuller wrote:
> Joe Wilk wrote:
>
>>Foolishly, I used the gedit editor that came with redhat 9. When I
>>realized that I had been punk'd, I edited the junk out of the file and
>>ran it. Everything good.
>>
>>To other newbies: Beware, not all text is wysiwyg (what you see is
>>what you get). Jeeezus!!!

>
>
> I'd be very interested in seeing what "junk" was added to the tail of the
> file.
>


Reply With Quote
  #9 (permalink)  
Old 01-27-2004
David Douthitt
 
Posts: n/a
Default Re: Why won't sripts work in REDHAT?

On 30 Dec 2003 14:20:10 -0800, cagey_cretin@netzero.com (Joe Wilk)
wrote:

>My problem was that I took the manual literaly. It says that 'any text
>editor can be used to create shell scripts". What it does NOT say is
>that when you open it up in VI you may find extra charecters added
>courtesy of the editor you use.


Generally, that's true. Of course, it needs to be able to generate
UNIX end-of-line characters (unlike Windows files and Macintosh files
and Apple II files).

However, you must use a _text_editor_ and not a _word_processor_.

MacWrite is a word processor; so is Microsoft Word and AbiWord and
many others. vi and emacs and pico and others are text editors.

I'd stick with vi; it's the best anyway. (duck and run!) If you
like, you could use gvim which gives you a graphical interface on top
of vi with menu items, et al.

David Douthitt (david@douthitt.net)
UNIX System Administrator
HP-UX, Unixware, Linux
Linux+, LPIC-1
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



All times are GMT +1. The time now is 10:52 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0