Linux Newbie help
 help / color / mirror / Atom feed
* Suggestion for help-page?
@ 2002-04-28 20:45 Staci
  2002-04-28 21:04 ` 1stFlight
  0 siblings, 1 reply; 5+ messages in thread
From: Staci @ 2002-04-28 20:45 UTC (permalink / raw)
  To: linux-newbie

Hi!

I want to write a tiny simple bash script for moving
downloaded mp3s from my /home/me directory to my
/music directory.  
(Due to /music being fat32, it's actually a process,
cuz permissions with winFSs are goofy)

Can someone suggest a very VERY newbie-friendly
help-page for beginners trying to write a script?

Thanks!
sl

=====
**************************
In cyberspace nobody can hear you scream.

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Suggestion for help-page?
  2002-04-28 20:45 Staci
@ 2002-04-28 21:04 ` 1stFlight
  2002-04-28 21:34   ` Staci
  0 siblings, 1 reply; 5+ messages in thread
From: 1stFlight @ 2002-04-28 21:04 UTC (permalink / raw)
  To: Staci; +Cc: linux newbie

try this 

--begin--
   #!/bin/bash

cp -uv /home/me/*.mp3  /music/

--end--

All it's will do is copy any file ending in .mp3 to your /music directory. 
Note: Linux is case senstive and Windows is not, so the limit this script has 
is that it wont copy a MP3 file. Easily fixed and I know there's neater way 
of doing it, but I don't how to do it. Also when you create the file don't 
forget to make it executable, meaning...   "chmod u+x filename "

					Darryl

P.S. No worries about permissions, fat32 doesn't support them. Note: leave out 
the "begin" and "end" lines

On Sunday 28 April 2002 04:45 pm, Staci wrote:
> Hi!
>
> I want to write a tiny simple bash script for moving
> downloaded mp3s from my /home/me directory to my
> /music directory.
> (Due to /music being fat32, it's actually a process,
> cuz permissions with winFSs are goofy)
>
> Can someone suggest a very VERY newbie-friendly
> help-page for beginners trying to write a script?
>
> Thanks!
> sl
>
> =====
> **************************
> In cyberspace nobody can hear you scream.
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Suggestion for help-page?
  2002-04-28 21:04 ` 1stFlight
@ 2002-04-28 21:34   ` Staci
  0 siblings, 0 replies; 5+ messages in thread
From: Staci @ 2002-04-28 21:34 UTC (permalink / raw)
  To: linux-newbie

See, this is why I needed a help page.

I made one called test, it contained just this...

#!/bin/bash
cp /home/staci/*.mp3 /
cp /*.mp3 /industgoth/new
rm /*.mp3
rm /home/staci/*.mp3

That's the sequence I'd go thru if I did it by hand. 
And I ran it as root cuz only root has access to that
/industgoth dir.
And they're GONE.  All 20 or so of them.
They're not in /industgoth/new, not anywhere.  Why???
:(

sl


--- 1stFlight <1stflight@ameritech.net> wrote:
> try this 
> 
> --begin--
>    #!/bin/bash
> 
> cp -uv /home/me/*.mp3  /music/
> 
> --end--
> 
> All it's will do is copy any file ending in .mp3 to
> your /music directory. 
> Note: Linux is case senstive and Windows is not, so
> the limit this script has 
> is that it wont copy a MP3 file. Easily fixed and I
> know there's neater way 
> of doing it, but I don't how to do it. Also when you
> create the file don't 
> forget to make it executable, meaning...   "chmod
> u+x filename "
> 
> 					Darryl
> 
> P.S. No worries about permissions, fat32 doesn't
> support them. Note: leave out 
> the "begin" and "end" lines
> 
> On Sunday 28 April 2002 04:45 pm, Staci wrote:
> > Hi!
> >
> > I want to write a tiny simple bash script for
> moving
> > downloaded mp3s from my /home/me directory to my
> > /music directory.
> > (Due to /music being fat32, it's actually a
> process,
> > cuz permissions with winFSs are goofy)
> >
> > Can someone suggest a very VERY newbie-friendly
> > help-page for beginners trying to write a script?
> >
> > Thanks!
> > sl
> >
> > =====
> > **************************
> > In cyberspace nobody can hear you scream.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Health - your guide to health and wellness
> > http://health.yahoo.com
> > -
> > To unsubscribe from this list: send the line
> "unsubscribe linux-newbie" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at 
> http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at
> http://www.linux-learn.org/faqs
> 


=====
**************************
In cyberspace nobody can hear you scream.

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Suggestion for help-page?
@ 2002-04-28 22:24 Ray Olszewski
  2002-04-28 23:08 ` docv
  0 siblings, 1 reply; 5+ messages in thread
From: Ray Olszewski @ 2002-04-28 22:24 UTC (permalink / raw)
  To: Staci, linux-newbie

At 02:34 PM 4/28/02 -0700, Staci wrote:
>See, this is why I needed a help page.

Well ... it's why you need help, anyway. At this level, bash script syntax
just isn't very tricky. Whatever is wrong with you "test" script isn't all
that apparent, so I doubt that a "very VERY newbie-friendly help-page for
beginners" would help you much in troubleshooting this problem.

>I made one called test, it contained just this...
>
>#!/bin/bash
>cp /home/staci/*.mp3 /
>cp /*.mp3 /industgoth/new
>rm /*.mp3
>rm /home/staci/*.mp3
>
>That's the sequence I'd go thru if I did it by hand. 
>And I ran it as root cuz only root has access to that
>/industgoth dir.
>And they're GONE.  All 20 or so of them.
>They're not in /industgoth/new, not anywhere.  Why???
>:(

They are gone from their old location because you rm'ed them. Same thing for
the intermediate location (/). That's why they are "not anywhere". So one
obvious change is to get rid of the two rm lines, then run a script with
just the first 3 lines and see what happens. 

The interesting question is why they are not in /industgoth/new/, not why
they aren't "anywhere". Assuming the directory /industgoth/new/ exists, is
writable, and has enough room on the filesystem, I'd expect the mp3 files to
have made it there. (I would suggest changing the line to read
/industgoth/new/, with a trailing /, just to be safe.) 

In short, what you've written should work.

So why not offer up some details, like:

        ls -l /home/staci/*.mp3         before you run the shorter script
        ls -l /*.mp3                    after you run the shorter script
        ls -l /industgoth/new/          after you run the shorter script
        df                              after you run the shorter script
        ls -l /industgoth/              before -AND- after you run
                                                the shorter script

All this after you put a few *.mp3 files in /home/staci/, of course.


--
------------------------------------"Never tell me the odds!"---
Ray Olszewski                                        -- Han Solo
Palo Alto, CA           	 	         ray@comarre.com        
----------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Suggestion for help-page?
  2002-04-28 22:24 Suggestion for help-page? Ray Olszewski
@ 2002-04-28 23:08 ` docv
  0 siblings, 0 replies; 5+ messages in thread
From: docv @ 2002-04-28 23:08 UTC (permalink / raw)
  To: Ray Olszewski; +Cc: Staci, linux-newbie

As one very newbie to another,

Wouldn't it be "safer" to use 'mv' instead of 'cp' and 'rm'? That way, 
if the destination dir didn't exist (/industgoth/new) the script would 
error out and not have removed any of the mp3 files from the original 
location.

Also, was there a special reason for the copying them to the root dir 
instead of straight to the destination dir?

Ray Olszewski responded to:

>>I made one called test, it contained just this...
>>
>>#!/bin/bash
>>cp /home/staci/*.mp3 /
>>cp /*.mp3 /industgoth/new
>>rm /*.mp3
>>rm /home/staci/*.mp3
>>

-- 
Steve
docv@sbcglobal.net

In a world without walls and fences there is no need for windows nor gates.




-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-04-28 23:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-28 22:24 Suggestion for help-page? Ray Olszewski
2002-04-28 23:08 ` docv
  -- strict thread matches above, loose matches on Subject: below --
2002-04-28 20:45 Staci
2002-04-28 21:04 ` 1stFlight
2002-04-28 21:34   ` Staci

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox