Hi,
I created the following shell script to lookup multiple name servers for a domain.
#!/bin/bash
echo -n "Enter the domain name and press : "
read domain
result1=`dig +short $domain @4.2.2.1`
revresult1=`host $result1 | cut -f5 -d " "`
echo "test1"
result2=`dig +short... (3 Replies)
Hey, im trying to validate a user input and need some help. The input needs to be just a single letter. Im using a case to so this eg:
read answer
case $answer in
*) echo "OK"
;;
*) echo "This is a number"
read answer
;;
*) echo... (2 Replies)
Well, I think I've managed to take two different issues and conglomerate them into and embarrasing mess.
#!/bin/bash
# Set some variables
dir1=/path/that/isnt/variable/$variabledir/dir/
dir2=/path/that/isnt/variable/$variabledir/important/"$variabledir"-subdirectory/path/
echo "Gimme... (7 Replies)
Hi all, I currently have a script which uses read -p for user interaction. e.g.
read -p "New user? " user
Is it possible to have it so if the user enters nothing and just presses return it can resort to a specified value instead?
Thanks! :) (5 Replies)
Hello Experts,
I have a script that that transfers a file (via sftp) and it works fine but we ran into a snag where the target server asked for the ssh key and the script didn't know what to do. I want to add some logic to this script that at least sends an email that it didn't complete as... (4 Replies)
I am starting to learn how to use bash and I would like the script to do the following:
Asks the user for his/her name
Asks the user for one number
Asks the user for another number
Then it adds the two numbers,
Also multiply the two numbers
I have the part where you get the name, and I... (3 Replies)
hi all,
i have a script that need user input provide all variables that needed to complete a job.
this is my current script:
echo "type file source and it full path :"
read INPUTFILE
if || ;
then
echo "ERROR: you didn't enter a file source or file source is not... (2 Replies)
Hi, I have written a script that allows me to repetitively play a music file $N times, which is specified through user input. However, if I want to exit the script before it has finished looping $N times, if I use CTRL+c, I have to CTRL+c however many times are left in order to complete the loop.... (9 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I have written a script for a dice game that: (1) tells user that each of the 2 die are 6 sided (Spots=6); (2)... (3 Replies)
In the bash below the out put of a process is written to input. What I am trying to do is read each line in the input and verify/check it for specific text (there are always 6 lines for each file and the specific text for each line is in the description). There will always be 6 lines in each... (5 Replies)
Discussion started by: cmccabe
5 Replies
LEARN ABOUT DEBIAN
ppd_find_choice
ppd_find_choice(3) Library Functions Manual ppd_find_choice(3)NAME
ppd_find_choice, ppd_find_marked_choice, ppd_find_option_by_keyword - set of functions for returning pointers to choices from PPD files.
SYNOPSIS
#include <ppd.h>
PpdChoice *ppd_find_choice (PpdOption *o, const char *choice);
PpdChoice *ppd_find_marked_choice (PpdFile *ppd, const char *keyword);
PpdOption *ppd_find_option_by_keyword (PpdFile *ppd, const char *keyword);
DESCRIPTION
These three functions allow the programmer access options and choices within a PPD file.
PpdChoice *ppd_find_choice (PpdOption *o, const char *choice);
This function accepts two parameters. The first is a pointer to a PPD option structure and the second is the name of the choice to locate.
PpdChoice *ppd_find_marked_choice (PpdFile *ppd, const char *keyword);
This function accepts a valid PpdFile pointer (see ppd_file_new(3)) and a keyword or option name to locate in the PPD file.
PpdOption *ppd_find_option_by_keyword (PpdFile *ppd, const char *keyword);
This function accepts two parameters which are identical to those used when invoking the ppd_find_marked_choice() function. However, the
ppd_find_option_by_keyword() function does not mark the designated option as being selected.
RETURN VALUE
ppd_find_choice()
Return a pointer to an option choice; NULL in the case of a failure
ppd_find_marked_choice()
Return the marked choice for the specified option; NULL in the case of a failure
ppd_find_option_by_keyword()
Return a pointer to the specified option; NULL in the case of a failure
SEE ALSO ppd_file_new(3), ppd_emit_to_file(3), ppd_file_free(3), ppd_get_num_conflicts(3), ppd_check_option_is_marked(3), ppd_get_page_length(3)AUTHOR
This man page was written by Gerald Carter <gcarter@valinux.com>. It was updated by Mark Fasheh <mfasheh@valinux.com> to reflect changes
in libppd 0.5 Some of the code for these functions was originally part of the Common UNIX Printing System (CUPS).
ppd_find_choice(3)