The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 01:24 PM
Simple Array in Ksh Scripting ravikirankethe UNIX for Dummies Questions & Answers 2 11-01-2006 11:35 AM
HELP me PLS... Simple Scripting! liezer Shell Programming and Scripting 2 09-14-2006 09:50 AM
simple scripting question gennaro Shell Programming and Scripting 3 06-17-2005 02:49 AM
Unix Tutorials/Programming Tutorials/Shell Scripting Tutorials Perderabo Answers to Frequently Asked Questions 0 04-25-2004 01:00 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-12-2003
xyyz xyyz is offline
Registered User
  
 

Join Date: Sep 2001
Posts: 114
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.
  #2 (permalink)  
Old 03-12-2003
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
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
xyyz xyyz is offline
Registered User
  
 

Join Date: Sep 2001
Posts: 114
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
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
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.
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:32 PM.


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