11-25-2001
Also, your case statement must not have a space following the dollar-sign. It needs to be $choice. And if you are wanting this menu to repeat, you can put it in a while-statement like:
#!/bin/sh
choice=0
while [ $choice -ne 9 ]
do
echo "system monitor"
echo "
1) system paging
2) system file inf.
3) system disk inf.
9) exit
"
echo "select an option: \c"
read choice
case $choice in
1) sar -p;;
2) sar -u;;
3) diskusage -p;;
9) ;;
*) echo 'Invalid choice'
sleep 1;;
esac
done
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Can somebody give me the explanation for this command line:
ps>newfile<infile wc -l
?
I am totally confused with the order of its execution.. :confused:
Thanx,
Saneesh Joseph. (3 Replies)
Discussion started by: saneeshjose
3 Replies
2. UNIX for Dummies Questions & Answers
Hi Group ,
I m trying to execute commands on some other system using write command but inspite of executing the commands they r passed as simple messages.
- i m writing
>write user-id
! ls
o
ctrl-d
inspite of executing the command ls,other terminal shows ! ls.
Thnx in advance. (2 Replies)
Discussion started by: Aashish
2 Replies
3. Shell Programming and Scripting
If I have a flat file date.txt separate by a tab
date1 date2 count
20060226 20060225 2
20060227 20060226 2
20060228 20060227 5
20060314 20060228 2
20060315 20060314 1
If $3 (count) is 5 then execute the script testit.ksh with... (13 Replies)
Discussion started by: sabercats
13 Replies
4. Shell Programming and Scripting
I'm trying to populate a command line into a variable. It appears to be executing, instead. Here's an example:
mycmd=''
if ...; then
$mycmd='sudo '
fi
$mycmd=$mycmd 'sed -i prev s/aaa/bbb/' $myfile
res=`$mycmd`
(I'm also not sure of the best way to execute the command from the... (1 Reply)
Discussion started by: littlejon
1 Replies
5. UNIX for Dummies Questions & Answers
How to make it works this way?
echo dir1\/*.txt ; echo dir1\/*.html | xargs wc -l
dir1/*.txt
wc: dir1/*.html: No such file or directory
what i'm trying to do it to "wc dir1/*.txt" and "wc dir1/*.html" (2 Replies)
Discussion started by: Bornay6ah
2 Replies
6. UNIX for Dummies Questions & Answers
Hi guys,
I'm completely new to UNIX and Linux and all that stuff. I've been using webhosting (shared) for some time years now and recently I've wanted to carry out some tasks that have had some commands which are not familiar to me. One was to install Mailman and the other to copy files from one... (6 Replies)
Discussion started by: BenA
6 Replies
7. Shell Programming and Scripting
HI,
I have a directory called input directory called "input", The "input" directory contains file names (file1,file2,file3,file4), I want to write a command so that it will display all the file names with comma separated.
Desired output: file1,file2,file3 so on....
Regards
Akshay... (2 Replies)
Discussion started by: akshu.agni
2 Replies
8. Shell Programming and Scripting
I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found"
My code is as follows:
--------------------------
#!/bin/sh
user="test"
DIR="/bldtmp/"$user
VIEW="test.view1"
echo "TMPDIR before export... (4 Replies)
Discussion started by: dchoudhury
4 Replies
9. Shell Programming and Scripting
Hello :)
new to bash not to programming.
I have an on-going need to change the owning group on sets of files and directories from the one they were created with or changed to on update to the one they need to have going forward.
find {target_root} -group wrong_group
gets me a newline... (4 Replies)
Discussion started by: naftali
4 Replies
10. Shell Programming and Scripting
Hello i am having an issue with bash script and this is the code
now=$(cat hosts1.txt | awk '{print $2;}')
while read n ;do
ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers'
When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies
LEARN ABOUT DEBIAN
ppd_check_option_is_marked
ppd_check_option_is_marked(3) Library Functions Manual ppd_check_option_is_marked(3)
NAME
ppd_check_option_is_marked, ppd_mark_defaults, ppd_mark_option - a set of functions for determining the current status of PPD options and
selecting them.
SYNOPSIS
#include <ppd.h>
gboolean ppd_check_option_is_marked (PpdFile *ppd, const char *keyword, const char *option);
gint ppd_mark_option(PpdFile *ppd, const char *option, const char *choice);
void ppd_mark_defaults (PpdFile *ppd);
DESCRIPTION
These three functions are used to query the marked status of an option in a PPD file as well as forcing an option to be selected.
ppd_check_option_is_marked(PpdFile *ppd, const char *option, const char *choice);
ppd_check_option_is_marked() accepts three parameters as input. The first is the PpdFile pointer to a PPD file obtained by calling one of
the ppd_load(3) functions. The second parameter is the option of the keyword name. The final input parameter is the actual choice name.
ppd_mark_option(PpdFile *ppd, const char *option, const char *choice);
ppd_mark_option allows the programmer to manually select an option in a PPD file. The parameters are the a valid PpdFile pointer (see
ppd_file_new(3)), the option name, and the choice name.
void ppd_mark_defaults (PpdFile *ppd);
ppd_mark_defaults() resets all the default options in the PPD file specified by the PpdFile pointer (see ppd_file_new(3)).
RETURN VALUE
ppd_check_option_is_marked()
FALSE if the option is not currently selected and TRUE is it marked
ppd_mark_option()
Always returns 0. The only means of determining whether or not the function succeeded is to make a subsequent call to
ppd_check_option_is_marked() on the same option.
SEE ALSO
ppd_file_new(3), ppd_emit_to_file(3), ppd_file_free(3), ppd_find_choice(3), ppd_get_num_conflicts(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 was originally part of the Common UNIX Printing System (CUPS).
ppd_check_option_is_marked(3)