Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Display header in script output Post 302863599 by bakunin on Monday 14th of October 2013 06:31:22 PM
Old 10-14-2013
What you want to do is simple:

Code:
# pseudocode:
if [ command line options passed include "-h" ] ; then
     header="-h"
else
     header=""
fi

How you can achieve that: see CarloMs post above. getopts (probably preferable to "getopt" because being a shell builtin) is the canonical method.

I hope this helps.

bakunin
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

getting the column header in the output !

i have a script that access the database and then returns some row. but in the command prompt it it not showing the column header. how to get that ? below the script: ------------------------------------------------------------------------ #!/bin/ksh .... (4 Replies)
Discussion started by: ali560045
4 Replies

2. Shell Programming and Scripting

Need SQL output without the header.

Hi, In a script i am trying to run a SQL by connecting Sybase DB. While executing the script I am getting the output with the header. means: Employee_Name--------------------------- Anup Das I need the Output: Anup Das Kindly advice. (2 Replies)
Discussion started by: anupdas
2 Replies

3. Shell Programming and Scripting

Help with ksh script to display output with specific contents

This is Input - starts with Storage Group Name and ends with Shareable and the loop continues all I need is Storage group name and Alu numbers in the below output format requested. Storage Group Name: abcd Storage Group UID: 00:00:000:00:0:0:0 HBA/SP Pairs: HBA UID ... (6 Replies)
Discussion started by: maddysa
6 Replies

4. Shell Programming and Scripting

Redirect an output from a script to a file and display it at a console simultaneously

Hi, I'd like to redirect the STDOUT output from my script to a file and simultaneously display it at a console. I've tried this command: myscript.sh | tail -f However, it doesn't end after the script finishes running I've also tried this: myscript.sh | tee ~/results.txt But it writes... (3 Replies)
Discussion started by: wenclu
3 Replies

5. Shell Programming and Scripting

Manipulate all rows except header, but header should be output as well

Hello There... I have a sample input file .. number:department:amount 125:Market:125.23 126:Hardware store:434.95 127:Video store:7.45 128:Book store:14.32 129:Gasolline:16.10 I will be doing some manipulations on all the records except the header, but the header should always be... (2 Replies)
Discussion started by: juzz4fun
2 Replies

6. Shell Programming and Scripting

How to display the header of a matched row in a file?

Hi, So I am trying to print the first row(header) first column alongwith the matched value. But I am not sure how do I print the same, by matching a pattern located in the file eg File contents Name Place Jim NY Jill NJ Cathy CA Sam TX Daniel FL And what I want is... (2 Replies)
Discussion started by: sidnow
2 Replies

7. UNIX for Advanced & Expert Users

Graphical Display Of Script Execution & Output

Hello All i have a KSH script which basically takes attribute name as input argument and searches whole Netezza appliance and prints information of where that column is used (Table/Views) etc. Problem with this approach business users have to raise SUDO access request, Install Putty, run through... (1 Reply)
Discussion started by: Ariean
1 Replies

8. UNIX for Beginners Questions & Answers

Does anyone have a trick to run sdiff to display the filenames as a header?

Hi, Does anyone know if there is anyway to run sdiff such that it shows the name of the files as it display the results of the differences? That is, I want it to show the filenames on each column and then display the differences I can't find any option that allows this. Maybe someone has a... (2 Replies)
Discussion started by: newbie_01
2 Replies

9. Shell Programming and Scripting

awk to retain header lines in output

The awk below executes and produces the current output, which is correct, except I can not seem to include the header lines # and ## in the output as well. I tried adding !/^#/ thinking that it would skip the lines with # and output them but the entire file prints as is. Thank you :). file ... (8 Replies)
Discussion started by: cmccabe
8 Replies
eugene(1)						      General Commands Manual							 eugene(1)

NAME
eugene - mpdcron statistics client SYNOPSIS
eugene command [option] DESCRIPTION
eugene is an mpdcron client which can be used to interact with the statistics database. COMMANDS
By default these commands (except the first three) work on the current playing song. For more information about the expression syntax, see: <http://www.sqlite.org/lang_expr.html>. help Display help and exit. version Display version and exit. list [option...] expression List song/artist/album/genre. listinfo [option...] [expression] List song/artist/album/genre. count [option...] count [expression] Change play count of song/artist/album/genre. countabs [option...] count [expression] Change (absolute fashion) play count of song/artist/album/genre. hate [option...] [expression] Hate song/artist/album/genre. love [option...] [expression] Love song/artist/album/genre. kill [option...] [expression] Kill song/artist/album/genre. unkill [option...] [expression] Unkill song/artist/album/genre. rate [option...] rating [expression] Rate song/artist/album/genre. rateabs [option...] rating [expression] Rate (absolute fashion) song/artist/album/genre. addtag [option...] tag [expression] Add tag to song/artist/album/genre. rmtag [option...] tag [expression] Remove tag from song/artist/album/genre. listtags [option...] [expression] List tags of song/artist/album/genre. OPTIONS
-h, --help Show help options. -a, --artist Apply on artists instead of songs. -A, --album Apply on albums instead of songs. -g, --genre Apply on genres instead of songs. SEE ALSO
o mpdcron(1) o <http://alip.github.com/mpdcron/> REPORTING BUGS
If you find a bug, please report it at <http://github.com/alip/mpdcron/issues>. COPYRIGHT
Copyright (c) 2009 Ali Polatel <alip@exherbo.org> Free use of this software is granted under the terms of the GNU General Public License (GPL). AUTHORS
David Prevot <david@tilapin.org>. manual February 25, 2011 eugene(1)
All times are GMT -4. The time now is 06:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy