Execution problems to call the DB table through UNIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Execution problems to call the DB table through UNIX
# 8  
Old 08-24-2017
Hi.

If your script is working, then you can ignore this. However, shellcheck run across your script (on file z4) produces:
Code:
$ shellcheck z4

In z4 line 22:
cd $SRCFILEPATH
   ^-- SC2086: Double quote to prevent globbing and word splitting.


In z4 line 24:
FILECOUNT=`ls *"$FILENAMEPAT"*|wc -l`
          ^-- SC2006: Use $(..) instead of deprecated `..`
           ^-- SC2012: Use find instead of ls to better handle non-alphanumeric filenames.
              ^-- SC2035: Use ./*${VAR}* so names with dashes won't become options.


In z4 line 25:
echo $FILECOUNT
     ^-- SC2086: Double quote to prevent globbing and word splitting.


In z4 line 26:
   for file in "$FILENAMEPAT"*;
   ^-- SC2034: file appears unused. Verify it or export it.


In z4 line 32:
   ServiceName="xxxx"
   ^-- SC2034: ServiceName appears unused. Verify it or export it.


In z4 line 36:
      _EOF_
      ^-- SC1039: Use <<- instead of << if you want to indent the end token.

This is on a system like:
Code:
OS, ker|rel, machine: Linux, 3.16.0-4-amd64, x86_64
Distribution        : Debian 8.8 (jessie) 
shellcheck version: 0.3.4

Details on shellcheck:
Code:
shellcheck      analyse shell scripts (man)
Path    : /usr/bin/shellcheck
Type    : ELF 64-bit LSB executable, x86-64, version 1 (SYSV ...)
Help    : probably available with -h
Repo    : Debian 8.8 (jessie) 
Home    : http://hackage.haskell.org/package/ShellCheck (pm)

Best wishes ... cheers, drl
# 9  
Old 08-24-2017
Can I also suggest that your database connection with the sqlplus command is open to someone running ps and your credentials will be in plain view.

Could you either:-
  • Change the code so that th ecredentials are within the Here Document
  • Change the user account to be Identified Externally so you can connect with sqlplus /
Hopefully then, your userid and password will be less visible to casual snooping.



Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Execution problems

How to find a word in a directory which contains many files? i just want to count how many such words are present in all the files? This is the code which i tried for a single file echo "Enter the file name:" read file echo "Enter the word to search:" read word if then echo "The count... (4 Replies)
Discussion started by: Meeran Rizvi
4 Replies

2. Solaris

System call to get the routing table

I want to implement a feature in my project where I want to attach the virtual IP on the interface present at the top in Routing table. I know the command to print the routing table, its "netstat -r". But I need a system call, so that I don't have to go for parsing . Can someone please provide any... (1 Reply)
Discussion started by: amitanshu.verma
1 Replies

3. UNIX for Dummies Questions & Answers

Execution Problems with UNIX.

Hi Team, I created one file like tst.pl, it contains #!/usr/bin/perl use Spreadsheet::ParseExcel; During execution it's showing error like use: command not found. Pleast let me suggest how to use this perl menthods in Unix. Thanks in Advance, Reards, Harris (5 Replies)
Discussion started by: harris
5 Replies

4. Shell Programming and Scripting

Execution problems with sed

Hi,I confused how to use sed to deal with big file. example: the big file have some different urls just with filename. how can i use sed to fetch url except file name and replace to other urls with filename? thanks!!! (11 Replies)
Discussion started by: hshzh359
11 Replies

5. Shell Programming and Scripting

Problems in execution of sqlscript in unix

I am new to unix and trying to execute sql script from unix. I have function already in database and trying to execute it from Cygwin unix and getting stuck. Can someone guide me where I wrote the shell script wrong sqlplus -s scott/tiger declare a number:=3; b number:=4; c number; d... (2 Replies)
Discussion started by: pyerragudi
2 Replies

6. Shell Programming and Scripting

Execution Problems

this my source file ************* fixed *************** Begin equipmentId : d9 processor : fox number : bhhhhhh Variable # 1: Id : 100 Type : 9 nType : s gType : 5f mType : 4 LField : England DataField : london Length ... (6 Replies)
Discussion started by: teefa
6 Replies

7. Shell Programming and Scripting

Execution Problems!!

i have been working on this for a about 12 hours today say's end of file un expected any idea's using the bourne shell and its driving me nuts worked fine in bash but prof says make it work in bourne and good luck worth 13% any help would be awesome #!/bin/sh trap "rm mnt2/source/tmp/* 2>... (1 Reply)
Discussion started by: mrhiab
1 Replies

8. Programming

Problem with execution of fork system call if i use \n

hi all, i tried the following source codes: fork1.c: main() { printf("demo of fork\n"); fork(); printf("hello"); } output: demo of fork hello hello fork2.c: main() (3 Replies)
Discussion started by: pnirmala
3 Replies

9. IP Networking

any system call in unix to access ip routing table

hi is there any system call by which ip routing table can be accessed. (1 Reply)
Discussion started by: vinodkumar
1 Replies
Login or Register to Ask a Question