12-06-2007
direction symbol in a variable as part of the command
Hi,
How can I get this to work?
#!/bin/ksh
if [ -n "$1" ]; then
direction=">>"
else
direction=">"
fi
cat some_file_name $direction temp.txt
exit
This shell script is not happy with using "$direction" opposed to ">" or ">>".
Thanks.
Peter
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
This is what I tried:
vara=${varb}_count
(( vara += 1 ))
Thanks for help (4 Replies)
Discussion started by: pa3be
4 Replies
2. Shell Programming and Scripting
I am trying unsuccessfully to set into a variable a specific part of command output:
The command output will be as:
line 1: <varied>
line 2: 2 options:
option 1:
Set view: ** NONE **
or
option 2:
Set view: <different_name_of_views_always_without_spaces>
and I would like to get into... (7 Replies)
Discussion started by: orit
7 Replies
3. Shell Programming and Scripting
Hi,
i was using a input file to get the last line of the file.But now i have stored
the values from the file to a variable and want the last line from the variable . Slightly confused on how to extract that data from the variable.
previous code,
cat input.txt
<TIME>00:15:48</TIME>... (2 Replies)
Discussion started by: Shellslave
2 Replies
4. Shell Programming and Scripting
I may not being doing this description justice, but I'll give it a try.
I created a mailx script; there will be several messages using the same script where the only difference is the content. So I figured I'd make the content of the message a variable retrieved from a separate file. I have five... (5 Replies)
Discussion started by: royarellano
5 Replies
5. Solaris
deleteing post (0 Replies)
Discussion started by: dshakey
0 Replies
6. Shell Programming and Scripting
Hi,
I'm using bash and brand new to shell script. I would like to do the following.
I have a string which is "UPDATE=1.0". I would like to read the value "1.0" alone in a variable. i.e the things afer "=" How do I do that?
Thanks, (1 Reply)
Discussion started by: scriptfriend
1 Replies
7. Shell Programming and Scripting
I'm trying to replace path which is part of variable inside script file:
FROM:
ABC_HOME=$ABC_ROOT/abc/1.0
TO:
ABC_HOME=$ABC_ROOT/abc/1.5
I'm using this:
perl -pi -e 's\ABC_HOME=$ABC_ROOT/abc/1.0\ABC_HOME=$ABC_ROOT/abc/1.5\g' /apps/scripts/test.sh
This command is not working because... (2 Replies)
Discussion started by: djanu
2 Replies
8. Shell Programming and Scripting
Hello Friends,
I need a command (or script line) that allows me to use of a part of line (given by me) as a variable. Let us assume the name of the command is MYCMD.
When I type
MYCMD fish://mfong@vhl.gov.nd/homefolder/hhk/ADS/
it must do the following job
cd /homefolder/hhk/ADS/
... (18 Replies)
Discussion started by: rpf
18 Replies
9. Shell Programming and Scripting
Hi, I am new in scripting, and I am currently working on a script that will look for other files in a certain directory and exclude some file type.
this works fine:Find_File2Exclude=`find ${paths} -maxdepth 1 -type f \( ! -iname '*.out' ! -iname '*.auc' ! -iname '*.cps' ! -iname '*.log' ! -iname... (4 Replies)
Discussion started by: kedd05
4 Replies
10. Shell Programming and Scripting
Hi,
I am working on PGP encryption. I am getting public keys from some file.
One of the key has dollar sign in it "$" Example: "abc$123"
echo 'passphrase='$passphrase --> Giving correct value abc$123
But if I use $passphrase in PGP command getting Invalid passphrase error.
If I... (10 Replies)
Discussion started by: Sreehari
10 Replies
LEARN ABOUT PHP
trader_sarext
TRADER_SAREXT(3) 1 TRADER_SAREXT(3)
trader_sarext - Parabolic SAR - Extended
SYNOPSIS
array trader_sarext (array $high, array $low, [float $startValue], [float $offsetOnReverse], [float $accelerationInitLong], [float
$accelerationLong], [float $accelerationMaxLong], [float $accelerationInitShort], [float $accelerationShort], [float $acceleration-
MaxShort])
DESCRIPTION
PARAMETERS
o $high
- High price, array of real values.
o $low
- Low price, array of real values.
o $startValue
- Start value and direction. 0 for Auto, >0 for Long, <0 for Short. Valid range from TRADER_REAL_MIN to TRADER_REAL_MAX.
o $offsetOnReverse
- Percent offset added/removed to initial stop on short/long reversal. Valid range from 0 to TRADER_REAL_MAX.
o $accelerationInitLong
- Acceleration Factor initial value for the Long direction. Valid range from 0 to TRADER_REAL_MAX.
o $accelerationLong
- Acceleration Factor for the Long direction. Valid range from 0 to TRADER_REAL_MAX.
o $accelerationMaxLong
- Acceleration Factor maximum value for the Long direction. Valid range from 0 to TRADER_REAL_MAX.
o $accelerationInitShort
- Acceleration Factor initial value for the Short direction. Valid range from 0 to TRADER_REAL_MAX.
o $accelerationShort
- Acceleration Factor for the Short direction. Valid range from 0 to TRADER_REAL_MAX.
o $accelerationMaxShort
- Acceleration Factor maximum value for the Short direction. Valid range from 0 to TRADER_REAL_MAX.
RETURN VALUES
Returns an array with calculated data or false on failure.
PHP Documentation Group TRADER_SAREXT(3)