Devam Ediyor

UNIX Scripts

4 Scipts

SCRIPT 1

# Purpose: This script prints out file sizes as either small, medium or

# large.

# Input: File Name(required)

# Procedure: 1 - Check that the fileName is entered. If not 1 parameter,

# print an error and exit.

# 2 - Check that the file exist. If not, print a message and

# exit.

# 3 - Do an "ls" and pipe the output to cut. Cut the columns

# that contain the size and save them to a variable.

# 4 - Branch on the size:

# 1 - if 1000 but 100000 print ${filename} is large

# Useage: fileSize file

SCRIPT 2

#!/bin/ksh

# Copyright 2004: All rights Reserved.

#

# Purpose: This script kills a process by the name of the command it is

running.

# Input: Command Name

# Procedure: 1 - Check that the commandName is entered. If not 1 parameter,

# print an error and exit.

# 2 - Do a ps and pipe the output to grep looking for the commandName.

# Send the output from grep to "/dev/null"

# 3 - Check the return code from grep. If commandName not found,

# print a message and exit.

# 4 - Run a "kill -15" on the results of a subshell that does

# a "ps" sending the output to grep, and then using cut to

# get the process id.

# Useage: pskill vi

SCRIPT 3

#

# Purpose: This script finds all files that contain the given string in this

# directory and all sub-directories.

# Input: string - the string to find

# Procedure: 1 - Check that the string is entered. If not 1 parameter,

# print an error and exit.

# 2 - Find all files in all subdirectories that are not directories

# themselves. (Or you can just find all files that are

# regular files). Save them in a variable.

# 3 - Do an iteration over all the files from step 2.

# 1 - grep in the file for the string, sending the output

# to /dev/null.

# 2 - Check the return code from grep. If the return code

# says the string was found, print out the file name.

# Useage: findInFiles string

#

SCRIPT 4

# script: findBadNames

# Purpose: This script finds all files in all subdirectories that do not

# have a specified string in their name.

# Input: String (required) - The string that must be in every file name.

# Note that the string is case insensitive, it can be either

# caps or lower case in the program name.

# Directory - The directory to look in. Default is "."

# Procedure: 1 - Check that the String and Directory have been entered.

# If just the string, set the default directory to ".".

# Otherwise print an error and exit.

# 2 - Do a find from the entered directory and write all

# the found files to a temporary file.

# 3 - grep for the string in the file of file names (make sure

# to use options for grep to make it case insensitive). Send

# the output to a temp file.

# 4 - Do a diff on the two temp files. The difference is the invalid

# file names.

# 5 - Clean up your temp files.

# Useage: findBadNames string [directory]

#

Beceriler: Sistem Yöneticisi

Daha fazlasını görün: up string, find unix, all sub, vi, unix admin, says, ps, prints, pipe, null, medium, exit, pipe error, string find, running error, error sending, save file directory, temporary, using scripts, string contain, find files directory, running unix, iteration, bin file, filesize

İşveren Hakkında:
( 0 değerlendirme ) Washington, United States

Proje NO: #79302

Seçilen:

rodrigogonzalez

Please check PMB

1 gün içinde 75$ USD
(25 Değerlendirme)
4.7

3 freelancer bu iş için ortalamada 72$ teklif veriyor

Aserdp

I have been a system admin for the last 8 years and can easily write the scripts for you.

in 2 gün içinde40$ USD
(17 Değerlendirme)
3.8
fountaintechies

Hello, Our team would be happy to work on a proper developement of the given script. Would you like us to use perl or shell scripting. Our system admin's can do it in 5 days max. Thanks.

in 5 gün içinde100$ USD
(0 Değerlendirme)
2.0