ken6503,
You haven't said which shell you're using.
I have forgotten how /bin/sh will expand $123 but I thought that:
would assign x the string abc followed by the contents of the 1st positional parameter followed by the string 23. I don't know why you didn't get the 23? If you were trying to set x to the literal string abc$123, you could do that with any of the following:
or millions of variations of any of those three possibilities.
There is nothing special about a dollar sign at the end of a string (unless the string ends with $$, so the code:
should produce the output:
I can't imagine that any shell, when given the commands:
will produce the period you showed us at the end of the output you reported:
Aia,
No, $123 does not expand to the value of the 123rd positional parameter; it expands to the value of the 1st positional parameter followed by the string 23. To get the 123rd positional parameter with a POSIX conforming shell, you would need to use ${123}. With a pure Bourne shell you can't reference any positional parameters after the 9th positional parameter directly without shifting away lower positional parameters.
And, expanding an undefined variable (including positional parameters) produces an empty string; not some undefined value.
These 2 Users Gave Thanks to Don Cragun For This Post:
:confused: Hi, does anyone here know how to compile and run C++ in UNIX environment? I am so desperate! Any help is greatly appreciated. Thanks! (3 Replies)
Hi.
Is it possible to remotely access another unix box via an enviroment variable, on another machine?
I am trying to create an environment variable $MIPSDATA which will point to a folder on another machine.
I have setup the .rhosts file and got that working on both machines (tested via a... (4 Replies)
Hi guys,
thanks in advance for this easy answer.... :s
Ok I am trying to output the enviroment varable for host in Solaris. I have tried $HOST, $HOST_NAME, $HOSTNAME carn't find it anywhere, does someone want to put me out of my misary and tell me what it is??? :confused: :eek:
Thanks... (2 Replies)
Hello...
I was wondering can anyone explain me how to set up enviroment variable to be permanent...
I tryed with setenv but my solaris does not have this command...
then I did:
export ORACLE_SID=base1
export ORACLE_BASE=/home
export ORACLE_HOME=$ORACLE_BASE/oracle/8.1.6
and by... (5 Replies)
Im looking for any sample scripts that would output a current environment setup to a file and possibly then take 2 files and list any differences
This will allow us to quickly see any differences between environments in case of issue?
At a high level this would take Unix Kernel Params,... (2 Replies)
What are the environment setting during a cron session?
I have HP-UX and I want to send the output/file from a script to several e-mail addresses. I want to create an env-var to store the e-mail addresses in my .profile, but I do not know if it will be visible when a script is executed in a cron. (4 Replies)
I need to save my enviroment variables,specially the $PATH.When I put it on .cshrc at next reboot I lost the configuration.How can avoid this?Thanks (2 Replies)
Hello,
I have a csh script that creates an environment variable. I want to pass the environment variable(CURR_TABLE_DATE) to an Informix sql script. Here is the csh:
#!/bin/csh -f
setenv INFORMIXSERVER market3_tcp
setenv CURR_TABLE_DATE 20090714
set DATABASE = gm_cdr
set SQL_DIR =... (0 Replies)
Hello,
First post for Newbie as I am stumped. I need to get certain elements for a specific PID from the ps command. I am attempting to pass the value for the PID I want to retrieve the information for as a variable. When the following is run without using a variable, setting a specific PID,... (3 Replies)
Hi Folks,
I have the below command that will kill all the process of an environment,
lets say if I have reached to the location cont directory under which I want to kill multiple process so the command will be ....
kill -9 `ps -ef | grep cont | grep -v grep | awk '{print $2}'`
Now please... (4 Replies)