![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
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 | ||
|
|
|
||||
|
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 You could also use wget or a similar utility to get files from ftp, then process locally... |
|
|||
|
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. |
|
||||
|
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 |