systemnotes org Location: System Notes / download / Shell / Mktestfile sh

Help for Aspiring Sysadmins

Linux / Open Source / Howto / Tips & Tricks

Language: en
 






Latest News

2009.07.29
RHCE Flash Cards Released

2008.01.11
Website Design Updated. This is a work in progress...

2008.01.11
RHCE Study Guide Removed due to a potential copyright issue

2007.12.03
RHCE Study Guide Released

 

Links:



Do you find this site useful?

donate









Spread Firefox Affiliate Button

Documents


#!/bin/sh
#===================================================================
#
#         FILE:  mktestfile.sh
#
#        USAGE:  ./mktestfile.sh > filename.txt
#
#  DESCRIPTION: Creates a testfile by combining keywords from two files.
# can be used for whois_check.sh to the availaility of a domain name.
#      OPTIONS:  -
# REQUIREMENTS:  Text files prefix.txt, and suffix.txt in current directory
#         BUGS:  -
#        NOTES:  Should work in linux or cygwin
#       AUTHOR:  Scott McClelland (ScottM), systemnotesorg AT yahoo DOT com
#      COMPANY:  systemnotes.org
#      VERSION:  1.0
#      CREATED:  2008-11-28
#     REVISION:  -
#===================================================================

for PREFIX in `cat prefix.txt`
do
   for SUFFIX in `cat suffix.txt`
   do
      echo ${PREFIX}${SUFFIX}
    done
done

#===================================================================
# Example Input Files:
#
# cat prefix.txt
# unix
# linux
#
# cat suffix.txt
# server
# support
# expert
#
# Example Output File:
#
#  cat unixtest.txt
# unixserver
# unixsupport
# unixexpert
# linuxserver
# linuxsupport
# linuxexpert

#===================================================================