The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Simple Scripting Problem felixwhoals Shell Programming and Scripting 3 12-16-2007 09:24 AM
Simple Array in Ksh Scripting ravikirankethe UNIX for Dummies Questions & Answers 2 11-01-2006 07:35 AM
HELP me PLS... Simple Scripting! liezer Shell Programming and Scripting 2 09-14-2006 06:50 AM
simple scripting question gennaro Shell Programming and Scripting 3 06-16-2005 11:49 PM
Unix Tutorials/Programming Tutorials/Shell Scripting Tutorials Perderabo Answers to Frequently Asked Questions 0 04-25-2004 10:00 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-12-2003
Registered User
 

Join Date: Sep 2001
Posts: 114
Stumble this Post!
any tutorials on simple scripting?

i'm not looking for anything that deals with "if-then" scripts.

i'd like something simple on how to run a series of processes. for example the following:

1. ftp://ftp.netbsd.org/pub/NetBSD/NetB...ent/tar_files/
2. lcd /
3. get pkgsrc.tar.gz
4. bye
5. cd /usr
6. rm -rf pkgsrc
7. cd /
8. tar -xzvpf pkgsrc.tar.gz -C /usr
9. cd /usr/pkgsrc/pkgtools/pkg_install
10. make install

i know how to make these cron jobs... but i don't know how to put them in a script so that they'll all happen at one time.
Forum Sponsor
  #2 (permalink)  
Old 03-12-2003
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Stumble this Post!
Well, since ftp is an automated process, you could use basic shell scripting, but I personally think one of the safest ways (error handling, etc) wou be to use Expect...

It could be done using here-docs in ksh/bash, though...
For example:
Code:
#! /bin/ksh

sitename=ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/

ftp -in <<-_EOF_
open ftp.netbsd.org
user anonymous email@address.com
cd pub/NetBSD/NetBSD-current/tar_files
[whatever goes here]
bye
_EOF_

cd /where/ever
do_some_stuff
If so inclined you could put some error handling in there, but that will basically do it for you...

You could also use wget or a similar utility to get files from ftp, then process locally...
  #3 (permalink)  
Old 03-12-2003
Registered User
 

Join Date: Sep 2001
Posts: 114
Stumble this Post!
here's the thing...

what you did... it's totally alien to me. i tried going through the man pages but they don't really help me learn simple things.

i tried a google search, but i didn't find anything particularly userful.

i would like a basic tutorial on how to do small things like i mentioned.
  #4 (permalink)  
Old 03-13-2003
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Stumble this Post!
I don't know of a place that is extrondinary for tutorials, but one good site I've used in the past is ShellDorado.

Also, search this site - automated ftps and scripting are brought up all the time...

Let me know if you have any specific questions.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:00 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0