Sponsored Content
Full Discussion: Help with test statement
Top Forums Shell Programming and Scripting Help with test statement Post 302482612 by drbiloukos on Wednesday 22nd of December 2010 05:24:26 AM
Old 12-22-2010
Help with test statement

Hello,
I am trying to build a test statement but I can't make it work
I want to rearrange some fields, so if my "$cfg" variable contains a string ending with .log (*.log) I want to move it in another field.
Any help will be much appreciated!
Thank you

Shell:sh
Code:
if [ "$cfg" = log ]
then
log="${cfg}"
cfg=""
fi

 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using grep in a test/if statement

Okay, well this is more or less my first attempt at writing a shell script. Anyways, here's my code: cd ${PATH} if then rm ${FILE} ./anotherScript else exit 1 fi exit 1 Anyways, it's a pretty simple script that is supposed to search for the... (4 Replies)
Discussion started by: cbo0485
4 Replies

2. UNIX for Dummies Questions & Answers

if test statement

Can you use an if statement after an else? example if then echo "word" else if then echo "word" (1 Reply)
Discussion started by: skooly5
1 Replies

3. Shell Programming and Scripting

Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d

This is the code: while test 1 -eq 1 do read a $a if test $a = stop then break fi done I read a command on every loop an execute it. I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test. For example echo hello. Now the... (1 Reply)
Discussion started by: Max89
1 Replies

4. Shell Programming and Scripting

Perl - automating if statement test

Hello all, I'm trying to automate an if statement in my Perl script. The script opens an input file for reading, checks each line in the file for a particular substring, and if it finds the substring, writes it to an output file. There are approximately 200 different input files. Each has... (3 Replies)
Discussion started by: Galt
3 Replies

5. Shell Programming and Scripting

How to check weather a string is like test* or test* ot *test* in if condition

How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies

6. Shell Programming and Scripting

string test in IF statement

How do I test multiple words in a string test like below: if ] then print "You entered $TBS name.\n" else print "You entered an incorrect response.\n" fi This test does not work. I have tried different syntax versions. How does this work? And is there a better way to do it? ... (10 Replies)
Discussion started by: djehresmann
10 Replies

7. Shell Programming and Scripting

If statement test against number range [0-9]

Is it possible to test against a varible within a ranges in a if statement. ex. if ];then echo "not in range" else echo "number within range" fi (8 Replies)
Discussion started by: leemalloy
8 Replies
OP_SERVER(8)						User Contributed Perl Documentation					      OP_SERVER(8)

NAME
op_server.pl - Proxy server for the Asterisk Flash Operator Panel SYNOPSIS
op_server.pl [options] Options: -?, --help -p, --pidfile -c, --confdir -l, --logdir -d, --daemon -v, --version -X, --debuglevel OPTIONS
--help Print a brief help message and exits --pidfile Specify the pid file to use when running in daemon mode. Defaults to /var/run/op_panel.pid --confdir Specify where to look for the configuration files. If omited, it will look for them in the same directory where op_server.pl resides --logdir If specified, will write the log files to that directory. If not, it will output to STDOUT and STDERR --daemon Run the server in daemon mode, detaching itself from the console --version Display the version and exits --debuglevel Sets the debug level for the logs. It overrides the value inside op_server.cfg DESCRIPTION
This program is a proxy server for the Flash Operator Panel. It reads configuration files and updates the data to display on the panel. FILES
/etc/op-panel The configuration files of the operator panel daemon reside in that directory (may differ on other distributions). Those include: op_server.cfg The server's configuration file. See remarks in file for documentation. op_buttons.cfg Defines the layout of the operator panel, and also which phones to track. /var/log/op-panel/output.log The standard output of the daemon, including debugging prints and dumps. /var/log/op-panel/error.log The standard error of the daemon. Should normally be empty. perl v5.10.1 2009-06-22 OP_SERVER(8)
All times are GMT -4. The time now is 10:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy