One way would be
When the string comes from user input, you could also split the string into words during input, like
When the user inputs "hello how are you", then s1 becomes "hello", s2 "how", and so on.
Hello,
I am an intermediate scripter. I can usually find and adapt what I need by searching through previous postings, but I'm stumped.
I have a string with the format "{Name1 Release1 Type1 Parent1} {Name2 Release2 Type2 Parent2}". It is being passed as an argument into a ksh script. I need to... (5 Replies)
search=Jul 22
date=Jul 22
if
then
echo They match
>>this piece of code does not detect that search and date are equivalent strings.. what's wrong with it? (17 Replies)
HI all,
Very new to shell programming and just wanted some help on how to solve the following problem.
I have a small shell script which searches a given file and extracts some string parameters. I want to now be able to call this script from another shell script and somehow pass the parameters... (11 Replies)
Is there any way to compare two strings for a greater or less than condition? For example, StringA is "apple" and StringB is "bonnet" and StringC is "captain". Can I only test for equal/not-equal, or is there a way to find out whether StringA is less than StringB, and StringC is greater than... (6 Replies)
I have two variables and want to perform some functions after comparison
$cat file1
14.abcde
a=`cut -f 1 -d "." file1
b=15
if
then
....
fi
but i got an error message says that unary operator expected
and i think its because of $a is a string and trying to compare with... (3 Replies)
I'm working in korn shell and have a variable which contains a string like:
aa_yyyymmdd_bbb_ccc_ddd.abc. I want to treat the _ and . as delimiters and parse the string so I end up with 6 values in variables that I can manipulate. My original plan was to use
var1=`echo $sting1 | cut -c1-c2` but... (9 Replies)
Hi guys,
I'm using tcsh.
I have a string that contains variable names: "var1:var2:var 3", I want to be able to do different operations on the content of those variables:
I extract the variable names with: foreach var ( `echo $string | sed 's/:/\n/g'`)
now in the variable `var` I have the... (1 Reply)
I have a file
$ cat myfile
A 02/16/2012
B 02/19/2012
C 02/20/2012
D 02/17/2012
E 02/16/2012
My simple script
> cat myscript.sh
mydate="02/16/2012"
awk ' ($2~/$mydate/) {print $1}' < myfile
but I got no output! and when I try $2~/'$mydate'/
I got: The error context is (2 Replies)
Here is what I'm trying to do.
A query embedded with a unix variable is stored in the database table. When it is pulled out, it has a variable in it and it needs to be replaced by the variable passed to the script below.
1. select cast(cmd_string as varchar(1000)) from mytable where... (1 Reply)
Discussion started by: sheila_ga2013
1 Replies
LEARN ABOUT HPUX
ctl_cyrusdb
CTL_CYRUSDB(8) System Manager's Manual CTL_CYRUSDB(8)
*
NAME
ctl_cyrusdb - perform operations common to all Cyrus databases
SYNOPSIS
ctl_cyrusdb [ -C config-file ] -r [ -x ]
ctl_cyrusdb [ -C config-file ] -c
DESCRIPTION
Ctl_cyrusdb is used to perform various administrative operations on the Cyrus databases.
Ctl_cyrusdb reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C. The configdirectory option is
used to determine the default location of the Cyrus databases.
OPTIONS -C config-file
Read configuration options from config-file.
-r Recover the databases after an application or system failure. Also performs database cleanup like removing mailbox reservations
(and any associated mailbox files).
All mailbox files are also checked to make sure the file format matches the configured database type in imapd.conf. If not, the
file is automatically converted using the same logic as cvt_cyrusdb.
-x Used with -r to recover the database only. (Prevents database cleanup).
-c Checkpoint and archive the databases. Changes to the database which are part of committed transactions are written to disk. Also,
a hot backup of the databases is made and inactive log files are removed.
FILES
/etc/imapd.conf
SEE ALSO imapd.conf(5), cyrmaster(8)CMU Project Cyrus CTL_CYRUSDB(8)