Results 1 to 4 of 4
I want to write a shell script (pack) to pack 3 files together. Like the winzip. And then to send it by email like attachments. Can anyone help me doing ...
- 04-23-2007 #1Just Joined!
- Join Date
- Mar 2007
- Posts
- 4
Pack several files
I want to write a shell script (pack) to pack 3 files together. Like the winzip. And then to send it by email like attachments. Can anyone help me doing this shell script.
I will use this command like
pack document1 document1 document3 > example
So the command "pack" it will pack the 3 files into the example folder.
Please help me. I m stack.
- 04-23-2007 #2
Look at the man pages for tar. You want something like this:
and to untar themCode:tar -cvf packed.tar document1 document1 document3
If you read the man pages you can make sure you use it the way you want.Code:tar -xvf packed.tar
Regards
- 04-23-2007 #3Just Joined!
- Join Date
- Mar 2007
- Posts
- 4
Yeah that' s right but i need to write a shell script for this command.
- 04-23-2007 #4Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
You might want to check out The Advanced Bash Scripting Guide. Basically shell scripts start with a shabang
To indicate the shell and that it is executable. After that it's just a shopping list of the commands you want to run. If you are having problems with any aspect of the script just askCode:#!/bin/bash


Reply With Quote