Sponsored Content
Full Discussion: help me with basics
Top Forums UNIX for Dummies Questions & Answers help me with basics Post 302607720 by balajesuri on Thursday 15th of March 2012 06:44:38 AM
Old 03-15-2012
If you put few commands in a logical sequence in a file and give it execute permissions, then this file becomes a script.

For e.g., you can write a script to forcefully delete all the log files in a directory and notify the user if removal was a success.

Code:
#! /bin/bash
rm -f /my/dir/*.log
if [ $? -eq 0 ]
then
    echo "All log files removed"
else
    echo "Looks like something happened"
fi

Shell script is a script written for a shell. And the shell could be any, depending on the OS you're working on.

Unix script could mean a script written specifically for any of the shells of Unix.
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Scripts and basics

Hi, I have a script which I need to modify the date "01/10/2008" and "31/10/2008" every month before running the report. Can I have some script to take the date automatically from the cal option. Hope it makes sense. Thanks in advance. (1 Reply)
Discussion started by: Jayanthsec
1 Replies

2. AIX

DB2 basics

Dear friends I am going to study DB2 and i dont have any experience with any DB's.. Please provide me with some links or pdf's for DB2 starters. any advice will be very usefull (2 Replies)
Discussion started by: Vit0_Corleone
2 Replies

3. UNIX for Dummies Questions & Answers

awk basics

Hi, Please tell me where can I get started with awk..like the basics and the whole awk stuff. Regards, Deepti (2 Replies)
Discussion started by: gaur.deepti
2 Replies

4. AIX

AIX Basics

Hello , Everyone , I want to know the Aix Basics and how it works ,hardware related problems and solution etc. (1 Reply)
Discussion started by: narendram
1 Replies

5. Shell Programming and Scripting

ls command basics???

how do i use the ls command with a single argument to list all files whose names end with the letter 'r'? (7 Replies)
Discussion started by: lilbo4231
7 Replies

6. UNIX for Dummies Questions & Answers

UNIX Basics

Hello, 1) I am trying to get involved in UNIX for educational purposes so I have installed the latest Ubuntu edition 12.04. Do you know another package that I could use it instead for educational purposes? 2)What is the difference between "~$" and "/$" (it comes with cd / and cd ~) .The... (1 Reply)
Discussion started by: Iwn
1 Replies

7. UNIX for Dummies Questions & Answers

UNIX basics

Hi, I am new to Unix. can you explain in brief with examples what is variable, what is argument and what is parameter? i searched a lot on other forums but not able to find a appropriate answer. thanks in advance!! (3 Replies)
Discussion started by: 21laps
3 Replies
BF_TAR(1)																 BF_TAR(1)

NAME
bf_tar - shell script to write a tar file of a bogofilter directory to stdout SYNOPSIS
bf_tar [-r] [-R] bogofilter_directory DESCRIPTION
bf_tar bundles a bogofilter working directory in tar format and copies it to standard output (your console, or where you redirect it, see EXAMPLES below). OPTIONS
The -r option causes bf_tar to remove inactive log files after the archive has been written successfully. The default is to leave log files. The -R option causes bf_tar to remove inactive log files before the archive is written. This may reduce chances that the resulting archive is recoverable should it become damaged. The archive may be smaller though. The default is to leave log files. EXIT STATUS
The script exits with status code 0 if everything went well, and nonzero if it encountered trouble. EXAMPLES
o bf_tar ~/.bogofilter > outfile.tar Writes a standard .tar file containing the essential files from ~/.bogofilter to outfile.tar. o bf_tar ~/.bogofilter | gzip -9 -c > outfile.tar.gz Writes a gzipped .tar.gz file containing the essential files from ~/.bogofilter to outfile.tar.gz. o bf_tar `pwd`/mydirectory > outfile.tar Prepend $(pwd)/ or `pwd`/ if you want to specify an absolute path instead of a relative path. NOTES
This script is meant for use with Berkeley DB based bogofilter versions. This script requires a SUSv2 compliant pax utility. This script expects a SUSv2 compliant shell. Solaris systems should have the SUNWxcu4 package installed (when bogofilter is configured) so that /usr/xpg4/bin/sh can be used. 07/23/2007 BF_TAR(1)
All times are GMT -4. The time now is 02:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy