In a script , i would like to check if the argument ( $1, $2 inside the script) contain wildcard (*,? etc). how do i do it?
> script_name arg1 arg*
$1 (arg1) does not contain wildcard, but $2 (arg* )contains wildcard. how can i tell in script?
i need to do this is because :
if arg1... (3 Replies)
Here is the command in question for f in $(<uploads); do .
I only want this to execute if uploads is not empty. If uploads is empty I want the script to quit, actually before the for command. If its not apparent uploads is a text file.
Chris (3 Replies)
Hello All,
I have written shell script whcih at the max 3 parameters.
When only one commandline argument and other two command line arguments are passed as empty string like
eg : archive ' ' ' '
Then i need to check whether the commandline... (12 Replies)
How do I check if a file is empty in a sh script
I want to test in my shell script if the output file is empty and if it is do one thing and if it isnt empty do another?
any ideas? (8 Replies)
I have the list of users in user.log, under each user folder there is sub1 folder is there. i want to check whether sub1 is empty or not, if it is empty i have to skip that user user folder and iterate next user folders. i have the sample code,its not giving not proper results.
while read line... (8 Replies)
I need to check if a directory is empty using an if condition
in the pseudocode below
if ; then
else
although i looked at a few forums on this topic, I left feeling a little unclear and i could not use the command successfully
what can i substitute in the if conditon above,... (2 Replies)
If ($argv == “-debug”) then
Echo “in loop”
Endif
But this is not working. If I modify this code and remove “-“, then it works.
Similarly I am getting problem using grep command also
Grep “-debug” Filename
Can someone please help me on how to resolve these... (1 Reply)
hi,
i want to check whether a a variable contains some value or is empty in a shell script. so if the variable contains some value i want to do some job and if the variable doesnt contain any value then i need to skip that job.
here is a sample script
read_filenames.sh contains
... (5 Replies)
All,
I'm writing an argument checking block and running into an error. I want to confirm that $1 is one of two values. Here is what I have:
if ]; then
echo -e "\nPlease check your first augument. You used \"$1\"
which is not recognized. Please see usage:"
usage
... (9 Replies)
Hello
So i have that script collection, in which i have a single script to create a configuration file.
In there, i have multiple occourences of something like this:
prj_title=$(tui-read "What is the TITLE? ($prj_name):")
] && prj_title="${prj_name/_/ }"
They all work as expected, if... (5 Replies)
Discussion started by: sea
5 Replies
LEARN ABOUT DEBIAN
net::dns::sec::tools::timetrans
timetrans(3pm) User Contributed Perl Documentation timetrans(3pm)NAME
Net::DNS::SEC::Tools::timetrans - Convert an integer seconds count into text units.
SYNOPSIS
use Net::DNS::SEC::Tools::timetrans;
$timestring = timetrans(86488);
$timestring = fuzzytimetrans(86488);
DESCRIPTION
The timetrans() interface in Net::DNS::SEC::Tools::timetrans converts an integer seconds count into the equivalent number of days, hours,
and minutes. The time converted is a relative time, not an absolute time. The returned time is given in terms of days, hours, minutes,
and seconds, as required to express the seconds count appropriately.
The fuzzytimetrans() interface converts an integer seconds count into the equivalent number of weeks or days or hours or minutes. The unit
chosen is that which is most natural for the seconds count. One decimal place of precision is included in the result.
INTERFACES
The interfaces to the Net::DNS::SEC::Tools::timetrans module are given below.
timetrans()
This routine converts an integer seconds count into the equivalent number of days, hours, and minutes. This converted seconds count is
returned as a text string. The seconds count must be greater than zero or an error will be returned.
Return Values:
If a valid seconds count was given, the count converted into the
appropriate text string will be returned.
An empty string is returned if no seconds count was given or if
the seconds count is less than one.
fuzzytimetrans()
This routine converts an integer seconds count into the equivalent number of weeks, days, hours, or minutes. This converted seconds count
is returned as a text string. The seconds count must be greater than zero or an error will be returned.
Return Values:
If a valid seconds count was given, the count converted into the
appropriate text string will be returned.
An empty string is returned if no seconds count was given or if
the seconds count is less than one.
EXAMPLES timetrans(400) returns 6 minutes, 40 seconds
timetrans(420) returns 7 minutes
timetrans(888) returns 14 minutes, 48 seconds
timetrans(86400) returns 1 day
timetrans(86488) returns 1 day, 28 seconds
timetrans(715000) returns 8 days, 6 hours, 36 minutes, 40 second
timetrans(720000) returns 8 days, 8 hours
fuzzytimetrans(400) returns 6.7 minutes
fuzzytimetrans(420) returns 7.0 minutes
fuzzytimetrans(888) returns 14.8 minutes
fuzzytimetrans(86400) returns 1.0 day
fuzzytimetrans(86488) returns 1.0 day
fuzzytimetrans(715000) returns 1.2 weeks
fuzzytimetrans(720000) returns 1.2 weeks
COPYRIGHT
Copyright 2004-2012 SPARTA, Inc. All rights reserved. See the COPYING file included with the DNSSEC-Tools package for details.
AUTHOR
Wayne Morrison, tewok@tislabs.com
SEE ALSO timetrans(1)perl v5.14.2 2012-06-18 timetrans(3pm)