Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Bad substitution issues.. but why? Post 302980260 by joeyg on Thursday 25th of August 2016 01:08:39 PM
Old 08-25-2016
Been a while, but I think your line 54 should be using () and not {}

Code:
NUMBER_OF_FILES = $(ls ${PATH_TO_DATASET} |  wc -l) ## number of directories in the dataset

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bad Substitution

Need Help... I am getting a bad substitution error on my script on a Solaris Server. However the script has been proven to work on HPUX and Solaris servers... #!/usr/bin/sh # # Set the location of the tzupdater.jar file # JAR=/tmp/tzupdater.jar # <<<<< UPDATE THIS LINE... (3 Replies)
Discussion started by: D_Redd74
3 Replies

2. Shell Programming and Scripting

Array reference - bad substitution

I've created a series of arrays named as follows: row1 row2 row3 . . . row10 Each has 4 elements. I'm trying to echo the array elements out in a for loop. Here's what I have: for ((i=1;i<=10;i++)) do for ((j=1;j<=4;j++)) do eval out=${row`echo $i`} echo -n $out (3 Replies)
Discussion started by: swankgd
3 Replies

3. Shell Programming and Scripting

bad substitution error in ksh

hi, i created a shell script having the following content: #! /usr/bin/ksh FROM="myemail@domain.com" MAILTO="someemail@domain" SUBJECT="TEST" BODY="/export/home/adshocker/body.txt" ATTACH="/export/home/adshocker/attach.prog" echo $ATTACH ATTACH_NAME="${ATTACH##*/}" echo $ATTACH_NAME... (5 Replies)
Discussion started by: adshocker
5 Replies

4. Shell Programming and Scripting

bad substitution error in ksh

Hello, In bash I can use the following: TMP=12345 MID=${TMP:1:1} the expected result is: 2 but when using KSH I'm getting a ''bad substitution" error. What is the correct syntaxin ksh? Thanks (2 Replies)
Discussion started by: LiorAmitai
2 Replies

5. UNIX for Dummies Questions & Answers

bad substitution

#!/bin/bash a1=( win 12,01,02,03,04 ) a2=( pre 04,05,06 ) a3=( msn 06,07,08,09 ) Given the above arrays, I want the script to return/echo the following in a loop; win 12,01,02,03,04 pre 04,05,06,07 msn 06,07,08,09 But I can't get it to do as such. I've tried; (2 Replies)
Discussion started by: Muhammad Rahiz
2 Replies

6. Shell Programming and Scripting

bad substitution error!

Hi All, I'm building a new shell script but i'm facing a problem with one line which is giving "bad substitution" error. Please assist script lines: #!/bin/sh printf "%s: " "Occurrence DATE (YYYYMMDD)"; read DATE shortdate=${DATE#??} o/p: ./test1: bad substitution This command is... (2 Replies)
Discussion started by: Dendany83
2 Replies

7. Programming

Make: Bad Substitution

Hi, I have a make file which I try to execute, but it failed when it arrived to the line: for r in ${PIPESTATUS }; do if (($r != 0)); then exit $r; fi;done; With the Error: ""make:/bin/sh: Bad substitution"" Or the Error: "make:${PIPESTATUS[...}: Bad substitution" (Depend on the operating... (3 Replies)
Discussion started by: nadne
3 Replies

8. Shell Programming and Scripting

Why I get bad bad substitution when using eval?

Why I get bad replace when using eval? $ map0=( "0" "0000" "0") $ i=0 $ eval echo \${map$i} 0000 $ a=`eval echo \${map$i}` !!!error happens!!! bash: ${map$i}: bad substitution How to resolve it ? Thanks! (5 Replies)
Discussion started by: 915086731
5 Replies

9. Shell Programming and Scripting

Bad substitution

Cant undestand :) why i have an error on line 2.it is working on my other boxes #!/bin/bash ret=$(echo Q | timeout 5 openssl s_client connect "${1`hostname`}:${2-443}" -ssl3 2> /dev/null) if echo "${ret}" | grep -q 'Protocol.*SSLv3'; then if echo "${ret}" | grep -q 'Cipher.*0000'; then ... (7 Replies)
Discussion started by: kenshinhimura
7 Replies

10. Shell Programming and Scripting

Bad substitution - ShellCheck says okay

ShellCheck doesn't find any issues with this script. #!/bin/bash # color_meanings: explain meanings of colors used in bash ls eval "$(echo "no:fi:di:ln:pi:so:do:bd:cd:or:mi:su:sg:tw:st:ex" | sed -e 's/:/=/g; s/\;/\n/g')" { IFS=: for i in $LS_COLORS do ... (18 Replies)
Discussion started by: Xubuntu56
18 Replies
svm-train(1)							   User Manuals 						      svm-train(1)

NAME
svm-train - train one or more SVM instance(s) on a given data set to produce a model file SYNOPSIS
svm-train [-s svm_type ] [ -t kernel_type ] [ -d degree ] [ -g gamma ] [ -r coef0 ] [ -c cost ] [ -n nu ] [ -p epsilon ] [ -m cachesize ] [ -e epsilon ] [ -h shrinking ] [ -b probability_estimates ] ] [ -wi weight ] [ -v n ] [ -q ] training_set_file [ model_file ] DESCRIPTION
svm-train trains a Support Vector Machine to learn the data indicated in the training_set_file and produce a model_file to save the results of the learning optimization. This model can be used later with svm_predict(1) or other LIBSVM enabled software. OPTIONS
-s svm_type svm_type defaults to 0 and can be any value between 0 and 4 as follows: 0 -- C-SVC 1 -- nu-SVC 2 -- one-class SVM 3 -- epsilon-SVR 4 -- nu-SVR -t kernel_type kernel_type defaults to 2 (Radial Basis Function (RBF) kernel) and can be any value between 0 and 4 as follows: 0 -- linear: u.v 1 -- polynomial: (gamma*u.v + coef0)^degree 2 -- radial basis function: exp(-gamma*|u-v|^2) 3 -- sigmoid: tanh(gamma*u.v + coef0) 4 -- precomputed kernel (kernel values in training_set_file) -- -d degree Sets the degree of the kernel function, defaulting to 3 -g gamma Adjusts the gamma in the kernel function (default 1/k) -r coef0 Sets the coef0 (constant offset) in the kernel function (default 0) -c cost Sets the parameter C ( cost ) of C-SVC, epsilon-SVR, and nu-SVR (default 1) -n nu Sets the parameter nu of nu-SVC, one-class SVM, and nu-SVR (default 0.5) -p epsilon Set the epsilon in the loss function of epsilon-SVR (default 0.1) -m cachesize Set the cache memory size to cachesize in MB (default 100) -e epsilon Set the tolerance of termination criterion to epsilon (default 0.001) -h shrinking Whether to use the shrinking heuristics, 0 or 1 (default 1) -b probability-estimates probability_estimates is a binary value indicating whether to calculate probability estimates when training the SVC or SVR model. Values are 0 or 1 and defaults to 0 for speed. -wi weight Set the parameter C (cost) of class i to weight*C, for C-SVC (default 1) -v n Set n for n -fold cross validation mode -q quiet mode; suppress messages to stdout. FILES
training_set_file must be prepared in the following simple sparse training vector format: <label> <index1>:<value1> <index2>:<value2> . . . . . . There is one sample per line. Each sample consists of a target value (label or regression target) followed by a sparse representation of the input vector. All unmentioned coordinates are assumed to be 0. For classification, <label> is an integer indicating the class label (multi-class is supported). For regression, <label> is the target value which can be any real number. For one-class SVM, it's not used so can be any number. Except using precomputed kernels (explained in another section), <index>:<value> gives a feature (attribute) value. <index> is an integer starting from 1 and <value> is a real number. Indices must be in an ASCENDING order. ENVIRONMENT
No environment variables. DIAGNOSTICS
None documented; see Vapnik et al. BUGS
Please report bugs to the Debian BTS. AUTHOR
Chih-Chung Chang, Chih-Jen Lin <cjlin@csie.ntu.edu.tw>, Chen-Tse Tsai <ctse.tsai@gmail.com> (packaging) SEE ALSO
svm-predict(1), svm-scale(1) Linux MAY 2006 svm-train(1)
All times are GMT -4. The time now is 06:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy