Sponsored Content
Full Discussion: Back ticks and $()
Top Forums Shell Programming and Scripting Back ticks and $() Post 302843198 by bobbygsk on Monday 12th of August 2013 10:41:12 AM
Old 08-12-2013
Quote:
Originally Posted by ahamed101
Shouldn't you escape the single quotes around $VAL?

Code:
\'$VAL\'

--ahamed
Already tried it. Also tried using double quotes in place of single quote and combination of single quote, double quote, and escape character.
Just by using single quotes, I got the following error
Code:
$(sqlplus -s xxxx/xxxx@xxxx <<EOF
       set pagesize 0 LINESIZE 1000 feedback off verify off heading off echo off
       select count(1) from dual where dummy = \'X\';
       EXIT;
       EOF)


CHECK RUN STATUS
RUN STATUS    : 0
REC_EXIST     :   select count(1) from dual where dummy = \'X\'
                                          *
ERROR at line 1:
ORA-00911: invalid character
test.sh[XX]: count(1): unknown test operator
Records exists:   select count(1) from dual where dummy = \'X\'
                                          *
ERROR at line 1:
ORA-00911: invalid character
Records exists:   select count(1) from dual where dummy = \'X\'
                                          *
ERROR at line 1:
ORA-00911: invalid character

 

6 More Discussions You Might Find Interesting

1. HP-UX

Ticks in seconds.

Hello all, Is there any thumb rule or aproximation of the equivalence in second of one tick? Thank you in advance. (1 Reply)
Discussion started by: mig28mx
1 Replies

2. AIX

back to back printing in UNIX

Hi , Can you suggest me how to back to back printing in UNIX? Is there any way? Kindly advise. Regards Vijaya Amirtha Raj (3 Replies)
Discussion started by: amirthraj_12
3 Replies

3. IP Networking

Back-to-Back Connection using HBAs

Hi every body, Is it possible to connect two servers Back-to-Back (Point-to-Point) using HBA adapters & using Fiber. Note it is direct connection & there is no switches between the servers. I'm concern about using HBA adapters, it is possible or not. Thanks in advance. :) (3 Replies)
Discussion started by: aldowsary
3 Replies

4. Shell Programming and Scripting

Shell Script problem $( vs ticks [`]

ok so, I recently started using $(echo one two three) to execute commands in scripts instead of using `echo one two three`. This method works wonderfully on ubuntu. However, it doesn't seem to work on other unix systems, i.e redhat/sun sun solaris. I really hate to go back to the ticks "`"... (2 Replies)
Discussion started by: SkySmart
2 Replies

5. Shell Programming and Scripting

Passing variable to Expression in back ticks.

Hi, In my perl script I want to check whether *.csv files exist and take the count . Below is the code: $path = “/home/usr/jan/myfiles” my $File_Count = `ls *.csv | wc -l `; # Checks in the current directory #Works fine if files exists. my $File_Count = `ls $path/*.csv | wc -l `; # I need... (2 Replies)
Discussion started by: jisha
2 Replies

6. What is on Your Mind?

I'm back

Hi all, I used to post here years ago, and was a moderator, my old username: zazzybob. Anyway, after a few years away focusing on my career, I'm back and keener than ever to get involved in the unix.com community again. I'm looking forward to getting back into the swing of things, helping... (11 Replies)
Discussion started by: tokiwinter
11 Replies
LESSECHO(1)                                                   General Commands Manual                                                  LESSECHO(1)

NAME
lessecho - expand metacharacters SYNOPSIS
lessecho [-ox] [-cx] [-pn] [-dn] [-mx] [-nn] [-ex] [-a] file ... DESCRIPTION
lessecho is a program that simply echos its arguments on standard output. But any metacharacter in the output is preceded by an "escape" character, which by default is a backslash. OPTIONS
A summary of options is included below. -ex Specifies "x", rather than backslash, to be the escape char for metachars. If x is "-", no escape char is used and arguments con- taining metachars are surrounded by quotes instead. -ox Specifies "x", rather than double-quote, to be the open quote character, which is used if the -e- option is specified. -cx Specifies "x" to be the close quote character. -pn Specifies "n" to be the open quote character, as an integer. -dn Specifies "n" to be the close quote character, as an integer. -mx Specifies "x" to be a metachar. By default, no characters are considered metachars. -nn Specifies "n" to be a metachar, as an integer. -fn Specifies "n" to be the escape char for metachars, as an integer. -a Specifies that all arguments are to be quoted. The default is that only arguments containing metacharacters are quoted SEE ALSO
less(1) AUTHOR
This manual page was written by Thomas Schoepf <schoepf@debian.org>, for the Debian GNU/Linux system (but may be used by others). Send bug reports or comments to bug-less@gnu.org. Version 487: 25 Oct 2016 LESSECHO(1)
All times are GMT -4. The time now is 12:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy