Sponsored Content
Full Discussion: Problem in file usage option
Top Forums Shell Programming and Scripting Problem in file usage option Post 302466729 by puni on Wednesday 27th of October 2010 07:25:24 AM
Old 10-27-2010
Thank you sanjay
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

problem in ssh with -i option

Hi All, I want to ssh to a remote terminal i did the following steps 1. On the client run the following commands: 2. $ mkdir -p $HOME/.ssh 3. $ chmod 0700 $HOME/.ssh 4. $ ssh-keygen -t dsa -f $HOME/.ssh/id_dsa -P '' and then tried the following $ ssh -i $HOME/.ssh/id_dsa server ... (1 Reply)
Discussion started by: gauri
1 Replies

2. UNIX for Dummies Questions & Answers

Usage of prstat -j option.

Hi, I need to capture output of prstat command for certain pid's .I found it as prstat -j filename. I created a filename projlist gave the pid number on the projlist file and run the cmd like this >prstat -j projlist prstat: illegal argument -- projlist can anybody suggest how to... (1 Reply)
Discussion started by: vipin771
1 Replies

3. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

4. Solaris

correct usage of find's -prune option

I know one of the more seasoned veterans probably opened this thread looking for their chance to refer me to the site's search feature and let me tell you. I'VE LOOKED!!!! And I didn't find anything helpful... So, I've got a windows background and I'm fond of its search feature which comes... (6 Replies)
Discussion started by: ProGrammar
6 Replies

5. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

6. UNIX for Advanced & Expert Users

Problem with useradd, -p option in Solaris 10

Good day all. I'm trying to add a user with useradd and the -p option to assign a project name, but the result is that the user is created with an error message: "UX: useradd: user.root name should be all lower case or numeric." The command: useradd -d /export/home/tester -g rtpgrp -G... (2 Replies)
Discussion started by: BRH
2 Replies

7. IP Networking

Problem when I Open my WireShark - No Interfaces Option available

Hi gurus of unix, I haved installed my openSolaris in a HP530, Recently I use the following command beadm destry opensolaris1 beadm destry opensolaris2 After That I reboot my Laptop. Well when I go to my work I try to open my wireshark tool, but the option in GUI interface does not appear!!!... (2 Replies)
Discussion started by: andresguillen
2 Replies

8. Shell Programming and Scripting

Problem with -c option in Mailx command

Hi, I am using mailx command in shell script. When i put -c option for CC , i get error message as "Unknown flag: -c" . I checked manual of mailx command and found that ~c to be used but after using ~c also it is not working. My shell is Korn. Kindly let me know what i have to do . Thanks (9 Replies)
Discussion started by: krishna_gnv
9 Replies

9. Shell Programming and Scripting

Problem in Using fgrep Command with pattern file option

Hi, i am using fgrep command with following syntax fgrep -v -f pattern_file_name file file contains few line and have the pattern which i am giving in pattern file. My Problem is : its is not giving any output. while i am using fgrep -f pattern_file_name file it is showing all... (4 Replies)
Discussion started by: emresearch
4 Replies

10. Shell Programming and Scripting

Problem with -s option in IF

Hello Guys , I am trying to run below in one of my script but unable to get it succeed . Can anyone help me on this? I am using HP-UX. if then write_log " Both files are present . Mail will be send to respective teams." EMAIL_SUBJECT="MGCA - File Extraction Process COMPLETED"... (12 Replies)
Discussion started by: himanshu sood
12 Replies
cmdline(n)						Command line and option processing						cmdline(n)

__________________________________________________________________________________________________________________________________________________

NAME
cmdline - Procedures to process command lines and options. SYNOPSIS
package require Tcl 8.2 package require cmdline ?1.3.1? ::cmdline::getopt argvVar optstring optVar valVar ::cmdline::getKnownOpt argvVar optstring optVar valVar ::cmdline::getoptions arglistVar optlist ?usage? ::cmdline::getKnownOptions arglistVar optlist ?usage? ::cmdline::usage optlist ?usage? ::cmdline::getfiles patterns quiet ::cmdline::getArgv0 _________________________________________________________________ DESCRIPTION
This package provides commands to parse command lines and options. ::cmdline::getopt argvVar optstring optVar valVar This command works in a fashion like the standard C based getopt function. Given an option string and a pointer to an array or args this command will process the first argument and return info on how to proceed. The command returns 1 if an option was found, 0 if no more options were found, and -1 if an error occurred. argvVar contains the name of the list of arguments to process. If options are found the list is modified and the processed arguments are removed from the start of the list. optstring contains a list of command options that the application will accept. If the option ends in ".arg" the command will use the next argument as an argument to the option. Otherwise the option is a boolean that is set to 1 if present. optVar refers to the variable the command will store the found option into (without the leading '-' and without the .arg extension). valVar refers to the variable to store either the value for the specified option into upon success or an error message in the case of failure. The stored value comes from the command line for .arg options, otherwise the value is 1. ::cmdline::getKnownOpt argvVar optstring optVar valVar Like ::cmdline::getopt, but ignores any unknown options in the input. ::cmdline::getoptions arglistVar optlist ?usage? Processes the set of command line options found in the list variable named by arglistVar and fills in defaults for those not speci- fied. This also generates an error message that lists the allowed flags if an incorrect flag is specified. The optional usage-argu- ment contains a string to include in front of the generated message. If not present it defaults to "options:". optlist contains a list of lists where each element specifies an option in the form: flag default comment. If flag ends in ".arg" then the value is taken from the command line. Otherwise it is a boolean and appears in the result if present on the command line. If flag ends in ".secret", it will not be displayed in the usage. ::cmdline::getKnownOptions arglistVar optlist ?usage? Like ::cmdline::getoptions, but ignores any unknown options in the input. ::cmdline::usage optlist ?usage? Generates and returns an error message that lists the allowed flags. optlist is defined as for ::cmdline::getoptions. The optional usage-argument contains a string to include in front of the generated message. If not present it defaults to "options:". ::cmdline::getfiles patterns quiet Given a list of file patterns this command computes the set of valid files. On windows, file globbing is performed on each argu- ment. On Unix, only file existence is tested. If a file argument produces no valid files, a warning is optionally generated (set quiet to true). This code also uses the full path for each file. If not given it prepends the current working directory to the filename. This ensures that these files will never conflict with files in a wrapped zip file. The last sentence refers to the pro-tools. ::cmdline::getArgv0 This command returns the "sanitized" version of argv0. It will strip off the leading path and removes the extension ".bin". The latter is used by the pro-apps because they must be wrapped by a shell script. EXAMPLES
set options { {a "set the atime only"} {m "set the mtime only"} {c "do not create non-existent files"} {r.arg "" "use time from ref_file"} {t.arg -1 "use specified time"} } set usage ": MyCommandName [options] filename ... options:" array set params [::cmdline::getoptions argv $options $usage] if { $params(a) } { set set_atime "true" } set has_t [expr {$params(t) != -1}] set has_r [expr {[string length $params(r)] > 0}] if {$has_t && $has_r} { return -code error "Cannot specify both -r and -t" } elseif {$has_t} { ... } This example, taken (and slightly modified) from the package fileutil, shows how to use cmdline. First, a list of options is created, then the 'args' list is passed to cmdline for processing. Subsequently, different options are checked to see if they have been passed to the script, and what their value is. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category cmdline of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
argument processing, argv, argv0, cmdline processing, command line processing cmdline 1.3.1 cmdline(n)
All times are GMT -4. The time now is 10:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy