Is there any set of escapes / quoting that will get bash to keep the MYVAR contents together when I run it? I'd prefer not to use eval, since I'm passing my CMD to a function in another script I don't control.
No. If you double quote CMD then it will expand to one token and the shell will start looking for a command to execute whose name is the entire string, spaces and all. So, you cannot double quote $CMD when you invoke it. Without the double quotes, the results of the expansion will undergo field splitting, and quotes within the expansion are not special so they cannot be used to affect the field splitting step.
(Assuming a typical posix-like shell) Your only option is eval. Without it, what you are trying to do is impossible.
Regards,
Alister
when users ask for certain information about their systems. from my knowledge, I know that I'm supposed to go into the /var/adm file system of that user. now, can someone tell me what information exactly is contained in the /var/adm filesystems. I mean I want to know what information it is... (1 Reply)
While concatenating 2 values, one which expanded to fixed width & other not, I am not getting value expanded as fixed width.
Following is script for the same :
#!/bin/sh
var1="abc"
var2="def"
var1Fxd=`echo $var1 | awk '{printf("%-6s",$0)}'`
echo $var1Fxd""$var2
But, if I try -
echo... (2 Replies)
Hi!
I strated to script since 1 month and I don't have much expirience but this thing here is strange
I have a script where I want to store a svn command in a var to check it later
so it's like this
#!/bin/sh
list=`ssh itadmin@192.168.1.200 "ls /home/svn"` # this stores the list of... (13 Replies)
Greetings,
I've visited this forums for a long time and normally got an right answer but this time my problem doesn't seem to go away. What I'm trying to do is the following:
VAR="\n\nline1\nline2\nline3\nline4\nline5\nline6\nline7\n\n"
(The count of newlines is varying!)
If I echo this i... (3 Replies)
Hello all,
I am having difficulties writing an ftp script to retrieve a file via get using a variable name to pass the file name.
I know the name of the file I am going to retrieve, this file name has embedded spaces and punctuation in the name itself.
If I interactively use the get and I... (10 Replies)
Hi Guys!
I am facing Problem with SVM I mention the problem below:
I have Sunfire V210 machine and the partitions are as follows:
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 6134 29.77GB (6135/0/0) 62429760
1 swap wu ... (1 Reply)
Hi,
There is no "administrator" file in "/var/mail" directory........
can any one tell me what could be the reason for that?...and also how to resolve that???
Thanks,
~Kavi (4 Replies)
Hi,
The user "MadeInGermany" tried to help on the below post by saying "This has been asked before; see the links below.
Get your current LD_LIBRARY_PATH and redefine that in your ksh script!
"
Thanks for the help. but this did not help. And my post got locked. I can't reply on my previous... (5 Replies)
exec(): 0509-036 Cannot load program /usr/opt/freeware/bin/rpm because of the following errors:
0509-022 Cannot load module /opt/freeware/lib/libintl.a(libintl.so.1).
0509-150 Dependent module /opt/freeware/lib/libiconv.a(shr4.o) could not be loaded.
0509-152 Member... (4 Replies)
I am running plsql using printf on a shell, but i am getting some strange error, can someone point what exactly am i missing,
$ echo $SHELL
/bin/bash
$ printf "
> SET serveroutput ON trimspool on feed off echo off
> declare
> p_val number;
> d_val varchar2(10);
> begin
> SELECT... (1 Reply)