10-14-2013
Display header in script output
Hi -- Working on my own through the book "Learning the KornShell and came to task 4-1, which there is:
a script "highest" and it will sort an "album" file.
highest filename
The author mentions adding a header line to the scripts output if the user types in the -h option. It says "assume the option ends up in the variable "header" i.e $header is -h"
If user runs the script with -h, it will produce a header on the output that reads "Album Artist" and a new line" if the -h option is not used there is no header or new line.
From the book:
The expression
${header:+"Albums Artist\n")
yields null if the variable header is null or "Albums Artist\n" is not null.
we can put the line:
print -n ${header:+"Albums Artist\n"}
My problem is i do not know how to make $header relate to the -h option. It says "assume....." but i want to follow along and run the script. Tried the man pages, but no luck. If you have any ideas please respond. Thanks.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
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
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
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
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
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
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
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
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
LEARN ABOUT CENTOS
genresscript
GENRESSCRIPT(1) General Commands Manual GENRESSCRIPT(1)
NAME
genresscript - generate resource script from PE and NE binaries
SYNOPSIS
genresscript [FILE]...
DESCRIPTION
This manual page documents briefly the genresscript command. This manual page was written for the Debian GNU distribution because the
original program does not have a manual page.
Genresscript takes any number of PE or NE binaries, and outputs a resource script with all resources from the binaries listed. (Everything
but the destination filename will be filled in in the script.) This is useful when you already have extracted images and want to create a
resource script of them.
OPTIONS
-t
--type=ID
list resources of this type instead of group_icon
-b
--base=PATH
the default extraction name of all resources
-s
--sort sort alphabetically instead of using order in binary
--help display this help and exit
--version
output version information and exit
SEE ALSO
extresso(1), icotool(1), wrestool(1).
AUTHOR
This manual page was written by Colin Watson <cjwatson@debian.org> and Oskar Liljeblad <oskar@osk.mine.nu>.
COPYRIGHT
Copyright (C) 2001 Colin Watson
Copyright (C) 2001 Oskar Liljeblad
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU-
LAR PURPOSE.
genresscript (icoutils) April 18, 2005 GENRESSCRIPT(1)