In one of my previous threads, someone suggested not to use backticks. When I googled, I came to know that back ticks are deprecated instead $() should be used. But I face issue while using $().
Note: I used echo of the sql just to debug.
The following is the code
The above code works fine as long as I use back tick. When I replace backticks with $(), I encounter the following error
By using $() I got good results for other scripts. Can anyone explain what went wrong.
Appreciate your response
Shouldn't you escape the single quotes around $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
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)
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)
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)
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)