Sponsored Content
Top Forums Shell Programming and Scripting Bad substitution - ShellCheck says okay Post 303029907 by Xubuntu56 on Saturday 2nd of February 2019 09:45:31 PM
Old 02-02-2019
Sorry! Still new at this game.

Code:
Desktop: Xfce 4.12.3 (Gtk 2.24.31) Distro: Ubuntu 18.04.1 LTS
~$ echo $BASH_VERSION 4.4.19(1)-release

When I enter env, LS_COLORS is displayed with exactly what TioTony described.
I removed the two backslashes mentioned, but still got the same error messages.


EDIT: I removed the two braces, and got the same results as before.

Last edited by Xubuntu56; 02-02-2019 at 10:54 PM..
 

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. UNIX for Beginners Questions & Answers

Bad substitution issues.. but why?

i am trying to prepare a train and test dataset, for which i need to randomly split the data into corresponding folders (train,test).. I began on a simple script, but seem to get som weird error messages, that i cannot make sense of?.. what am I doing wrong? #!/bin/bash RED='\033] then... (13 Replies)
Discussion started by: kidi
13 Replies
GtkCListModel(3)					User Contributed Perl Documentation					  GtkCListModel(3)

NAME
Gtk::CListModel - A simple data model with Gtk::Clist views SINOPSYS
my $model = tie @data, 'Gtk::CListModel', titles => ["Fruit", "Price", "Quantity"]; # all data manipulation is done on @data now push @data, ["Oranges", 5, 16]; # Create a view (a Gtk::Clist widget) to represent the data # Include only some of the data in the view (fruit type and price) # Also, do not include fruits that cost more than 6 price units. my $clist = $model->create_view('main', titles => ['Fruit', 'Price'], filter => sub {$_[1] > 6? () : @_}); DESCRIPTION
Gtk::CListModel lets you keep your data in a perl array and easily create a numer of different views on that data using Gtk::CList widgets. The views can show only some of the columns, or a subset of the data or even munge the data with user-defined filters. All the data manipulations will be performed on a tied array and the changes will be propagated to the views created for that data. To create the model use "tie": my $model = tie @data, 'Gtk::CListModel', titles => ["head1", "head2",...]; The "titles" attribute should be an array reference with the titles of the columns of data. They will be used also for the default titles in the views. You can also provide the initial data using the "data" attribute. Remember that the data elements you insert and retreive from the @data array are array references with as many items as the columns in the model. The order is the one defined by the "titles" attribute. Later you can manipulate the @data array with the usual perl array operators, push, splice and so on. METHODS
create_view ($name[, %options]) Create a Gtk::Clist widget that represents the data in the model. The name can be used later to disconnect the view from the data. Options can be one of the following: o titles An array reference of the titles of the columns to display in the list in the order they should appear in the view. The default is the titles specified at the model creation. o filter A function that can manipulate the data just before it is inserted in the Gtk::CList. The function will receive the data and can either make a copy and modify the data or return an empty list. In the latter case the data will not be added to the view or, if the corre- sponding row was already present, it will be removed from the view. o postfilter A function that receives the view, the row and the data that was just inserted/modified in the view. By default all the data is inserted in the views as text. This filter can be used to display pixmaps, for example or do any other kind of manipulations on the Gtk::CList row. remove_view ($name) Disconnect the named view from the data. The current data displayed in the view will not be affected, but changes in the model will not propagate to this view anymore. map_row ($clist, $row) Get the index in the data array cooresponding to the row displayed in the Gtk::CList widget. AUTHOR
Molaro Paolo lupus@debian.org perl v5.8.0 2001-06-26 GtkCListModel(3)
All times are GMT -4. The time now is 06:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy