Sponsored Content
Full Discussion: Formatting Script Output
Top Forums Shell Programming and Scripting Formatting Script Output Post 302130475 by liketheshell on Monday 6th of August 2007 10:38:19 AM
Old 08-06-2007
TY for the response. They both worked and put in the hostname. But what i wanted to acheive was really this. I wanted the script to output the hostname for every package output listed in the grep. So if the grep found say 5 packages it would list the hostname 5 times.

ie

machinename,packagename,version
machinename,packagename,version
machinename,packagename,version
machinename,packagename,version
machinename,packagename,version

In this kinda format. I just can't figure it out with the for loop.

Thanks for all your help
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Formatting the output of a script

Dear readers, I have a script that counts the number of files in particular directories in my home location and displays the output. Now I have 13 directories in my home location. I am getting the output as : Avishek_dir 13 Kunal_dir 17 Shantanu_dir 18 Arup_dir 12 Pranabesh_dir 19 . .... (7 Replies)
Discussion started by: avishek007
7 Replies

2. Shell Programming and Scripting

Formatting Sar Output script

Hi, We have 2 scripts below for reporting sar output which are pretty same. In first script i want to add to the program whatever is given in the comments. In second script I want to use while true to run this program every hour and everything that is in comment. Finally I want to club... (0 Replies)
Discussion started by: noorm
0 Replies

3. Shell Programming and Scripting

Formatting the query output using shell script

Hi All, I'm finding it difficult to format the query output that was returned in a shell script. Actually i have one shell script which does some DB stuff and depending on the result it will do some more tasks. My question here is to format the query output returned by mysql. Intitally my... (5 Replies)
Discussion started by: RSC1985
5 Replies

4. Shell Programming and Scripting

sql select command output formatting in shell script

Hi, I need to connect to the database and retrieve two variables from the database and store them in a variable,out of these two variables I need to get lastdigit appended to the variable 1 retrieved and variable 2 with out any modification in short select var,data from usage; o/p=... (1 Reply)
Discussion started by: rkrish
1 Replies

5. Shell Programming and Scripting

Need help with output formatting

Hey can anyone help me with newline formatting? i bet someone will ask why im rewriting du code, im trying to write a simple script that have slightly different function than du lol.... echo $(du "$dval" | tr ' ' '\n') atm with above code it will printout i've tried sed and awk... cant... (7 Replies)
Discussion started by: Nick1097
7 Replies

6. Shell Programming and Scripting

Problem in formatting output of SQL query in excel sheet in shell script

Hi Guys.. Need your help to format the output of my shell script. I am using spool command to take out put in csv file. below is my code. (for example) col USERNAME for a15 col EMAIL for a30 col FULL_NAME for a20 col LAST_LOGIN for a40 col DATE_CREATED for a40 SPOOL 120.csv... (3 Replies)
Discussion started by: Agupte
3 Replies

7. Shell Programming and Scripting

Formatting Shell script output to Excel

I am facing a problem formatting the output of my shell script in excel. We are directing the output of the script to an excel sheet and need long integer type data printed in Excel as it is (i.e. not in the default scientific notation). Also, leading zeroes(if any) in the output are getting... (4 Replies)
Discussion started by: bornali.p
4 Replies

8. Shell Programming and Scripting

Formatting output of script

I'm looking for a way to neaten up the out put of an ldapquery. I might get one, none, or several returns for each query; and each query consists of multiple lines. And while each return will contain the same types of info, it might be in a different order, like: uniq: 1 ip: 192.168.2.3... (3 Replies)
Discussion started by: jnojr
3 Replies

9. Shell Programming and Scripting

SQL Query in Shell Script output formatting

Hi All, #!/bin/ksh call_sql () { sql=$1 sqlplus -s $sqlparam_sieb <<EOF SET ECHO OFF; SET NEWPAGE NONE; SET SQLBL OFF; SET VERIFY OFF; SET LINESIZE 2000; SET... (2 Replies)
Discussion started by: Kevin Tivoli
2 Replies

10. Shell Programming and Scripting

awk Script Output in Outlook Formatting Issue

When i execute the below shell script with 2 different Input files, for one of the data files (datafile1) my email message body in the outlook messes up and every thing comes up in one line. May i please know what i am doing wrong here or how to fix this? The only difference in data files is one is... (1 Reply)
Discussion started by: Ariean
1 Replies
DH_MAKE(8)						      System Manager's Manual							DH_MAKE(8)

NAME
dh_make - prepare Debian packaging for an original source archive SYNOPSIS
dh_make [-nlsmiadhry] [-c license] [-e address] [-f file] [-t directory] [-o directory] [-p name] [--copyright license] [--email address] [--native] [--file file] [--library] [--single] [--indep] [--multi] [--kmod] [--kpatch] [--addmissing] [--yes] [--templates directory] [--defaultless] [--overlay directory] [--packagename name] [--rulesformat format] [--help] [--version] DESCRIPTION
dh_make is a tool to convert a regular source code package into one formatted according to the requirements of the Debian Policy. dh_make must be invoked within a directory containing the source code, which must be named <packagename>-<version>. The <packagename> must be all lowercase, digits and dashes. If the directory name does not conform to this scheme, you must rename it before using dh_make. Alterna- tively, you may be able to use the --packagename option to force the package name. PACKAGE CLASSES Classes can be set with the single direct options (such as --s for single) or with the -C,--packageclass option (-C=s for single). Single binary (s) The package will generate a single binary .deb package. It is the standard case, so if you don't know what to do, choose this. Arch-Independent (i) The package will generate a single package that is arch-independent. Multiple binary (m) The package will generate multiple binary .deb packages from one source package. Choose this for larger packages that need to be split. Library (l) The package will generate at least two binaries. One library package containing just the lib in /usr/lib and another *-dev_*.deb package containing documentation and C headers. Kernel module (k) The package will generate a binary-all kernel module -source package for use with the make-kpkg(1) command. It also generates a binary package for additional utilities, daemons, etc. that may come with the source. Kernel patch The package will generate a package that can be used for kernel patches. ACTIONS PERFORMED Unless --native was given, dh_make makes sure a original source archive (<packagename>_<version>.orig.tar.gz) exists. The archive can either end with .gz or one of the other supported compression extensions such as bz2 or lzma. If no such file exists, the file specified with -f is copied in place. If no -f is supplied either but --createorig is, the current directory is created into a news archive ../<packagename>-<version>.orig.tar.gz The original archive is needed for other Debian tools to generate the diffs to the original sources required by the Debian packaging format. Unless there are reasons against it, this file should be the pristine upstream archive. Then dh_make proceeds to generate a "debian" subdirectory and the necessary control files in the program source directory. Those control files are customized with the packagename and version extracted from the directory name. dh_make makes several attempts to obtain the username. It first checks for the environment variables $DEBFULLNAME, $LOGNAME is used to find a name in the /etc/passwd file, and through NIS, YP and LDAP. The e-mail address can either be specified with the -fB--email option or dh_make will attempt to find it. It will first check the environ- ment variables $DEBEMAIL and then $EMAIL. If they are not set then dh_make will search an available LDAP directory using ldapsearch(1) using $LOGNAME as the uid to search under. Finally it will use $LOGNAME and /etc/mailname to generate an email address. dh_make will also generate example files that are also customized for the package generated. You can remove all files with *.ex if you wish. You can also delete the README.Debian file if you don't have anything to put in it. Renaming the example files to their name without the .ex at the end (and editing them if necessary) will activate that feature of debhelper. If the --templates or -o (--overlay) option is used dh_make will apply a customizing template to the "debian" directory. See the templates described in the FILES section of this manpage for samples. OPTIONS
-c, --copyright license Use license type in copyright file. license can be gpl, gpl2, gpl3, lgpl, lgpl2 lgpl3, artistic, apache, bsd or mit. If this field is not specified the copyright file has a space to fill in which sort of license is used. The field is case-insensitive so -c GPL works as well as -c gpl. gpl and lgpl will give you version 3 of the corresponding license, apache implies Apache v2.0. If you need a different version, change the license file afterwards or use the gpl2 and lgpl2 options. -e, --email address Use address as the e-mail address in the Maintainer: field of debian/control file. -n, --native Create a native Debian packages, i.e. do not generate a .orig archive, since it will be generated when building with dpkg-buildpack- age. The version number will not have a Debian revision number (e.g. -1) appended to it. -f, --file file Use file as the original source archive, and skip the copying of the current program tree to program.orig. -l, --library Automatically set the package class to Library, skipping the question. -s, --single Automatically set the package class to Single binary, skipping the question. -i, --indep Automatically set the package class to arch-independent binary, skipping the question. -m, --multi Automatically set the package class to Multiple binary, skipping the question. -k, --kmod Automatically set the package class to Kernel module, skipping the question. --kpatch Automatically set package class to kpatch, skipping the question. -a, --addmissing Adds missing example and control files on an existing debian source directory. -t, --templates directory Applies the customizing templates in directory to the debian directory. -o, --overlay directory Applies a customization template to an existing debian directory. -p, --packagename name Force the package name to be name, good for packages with hyphens in their name or other strangeness. You can also make the parame- ter name_version which will set both the package name and version and bypass and directory checking. -d, --defaultless Skips applying the default templates to the target debian directory. -h, --help Display the name, version, available options and authors, and exit successfully. -r, --rulesformat format Set the format for the debian/rules file to format. The options are the default Debhelper v7 minimal rules (dh7), the old rules for- mat (old) or CDBS format (cdbs). -v, --version Show the program name and version, and exit successfully. -y, --yes Automatic yes to prompts and run non-interactively. The package class needs to be set for dh_make to run fully automatically. ENVIRONMENT
The following environment settings are used by dh_make: DEBEMAIL Email address to use in control and changelog entries. DEBFULLNAME You full name, eg "John Doe" which will appear in the control and changelog entries. EMAIL Email address to use in control and changelog entries, only used if DEBEMAIL is no set. LOGNAME Default username used for looking up email and full name in other directories. FILES
/usr/share/debhelper/dh_make Directory that contains all the template files, separated in six directories: debian/ with files for all package classes, debians/ with files specific to the Single binary class, debianm/ with files specific to the Multiple binary class, debianl/ with files specific to the Library class, and finally, native/ with files specific to the native Debian packages. licenses/ template files for the more common licenses used in Debian packages EXAMPLES
To get dh_make to use the defaults and ask you various questions about the package dh_make Create your single class package using the with the GPL license: dh_make -s -c gpl A more involved example where you set your name in the environment, contact email and license in the options and specify the upstream file: DEBFULLNAME="John Doe" dh_make --email contact@example.com --copyright=bsd --file ../foo.tar.gz BUGS
dh_make may not detect your username and email address correctly when using sudo. SEE ALSO
dpkg(1),dpkg-buildpackage(1),dh(1),make-kpkg(1),debhelper(7) You may also want to read the Debian Policy (in /usr/share/doc/debian-policy ) and the New Maintainers' Guide (in /usr/share/doc/maint- guide). Debian Project 2012-06-24 DH_MAKE(8)
All times are GMT -4. The time now is 01:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy