Ok tested the code at last, and while the parsing works pretty well, the variable $CFG_DIR is taken literally and I can't substitute any value for it. So when I try to execute the $cmd, I get the error "$CFG_DIR/ps_mon.cfg not found".
For this kind of situations there is the eval keyword. Its use is always the last resort, so this is not a "recommendation" and the advice is to handle it with extreme care.
Since you don't show us your code you will have to find out how to incorporate it yourself. Just so much: basically it starts the parsing of the command line a second time. Here is an example what that means:
Now, this will NOT work. One might expect that "$var" is expanded to "abc" and "$abc" is expanded to "123", but this is not the case. In fact all variables are expanded at the same time and once they are - they are. There is no going back and expanding a second time.
In comes eval. This indeed starts the whole parsing process a second time and hence:
will do the second indirection. This now works exactly like described above. Notice that the first "$" had to be escaped to protect it from being interpreted in the first parsing pass.
I want to go through the list of items and run it.
while running it, some of them will have either
>there is no response # and then end it... so that it can go to next item
OR
>there is response # but in order to break out of it, u need to do Control c.
How do you send control... (6 Replies)
I have the following statement in script:
find ${LANDING_FILE_DIR}${BTIME_FILENAME_PATTERN2} -print | while read file; do
...
done
When there are no files located by the find comand it returns:
"find: bad status-- /home/rnitcher/test/....." to the command line
How do I get control in... (3 Replies)
Hi,
I have taken a piece of code from a book, which is working as per the specification. The code....
for entry in *
do
if
then
echo $entry
fi
done
The sub-directories present in the current directory will be displayed while executing.
... (3 Replies)
I have an empty .gz file in archival directory. And I am redirecting to a dat file. My while loop is not getting ended. I need the solution.
cnt=0
while read line
do
cnt=`expr $cnt + 1`
echo "$ARCH_DIR/$line.gz" >> $DATA_DIR/$FILE_LIST_FILE_FEB
FILE_NAMES=${FILE_NAMES}"... (2 Replies)
Hey guys,
I have this file generated by me... i want to create some HTML output from it.
The problem is that i am really confused about how do I go about reading the file.
The file is in the following format:
TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Hello,
I would like to control and check the right parameters
$1 must have 4 alphabetics digits among eora qora pora fora
$2 must have 2 numerics digits 00 to 11
$3 must have 2 numerics digits 00 to 59
$4 must have 10 characters alpha numerics as 2013-02-26
For example :
In case 5) if i... (1 Reply)
Hello,
I would like to control and check the right parameters
$1 must have 4 alphabetics digits among eora qora pora fora
$2 must have 2 numerics digits 00 to 11
$3 must have 2 numerics digits 00 to 59
$4 must have 10 characters alpha numerics as 2013-02-26
For example :
In case 5) if i... (15 Replies)
Hello All,
I have an awk script which parses my log file and prints number grepping from a specific line/pattern, now i have to come with a shell script to continue reading the log untill the job is completed, which i would know while reading session log untill process encounters a final... (1 Reply)
Discussion started by: Ariean
1 Replies
LEARN ABOUT PLAN9
namespace
NAMESPACE(6) Games Manual NAMESPACE(6)NAME
namespace - name space description file
DESCRIPTION
Namespace files describe how to construct a name space from scratch, an operation normally performed by the newns subroutine (see auth(2))
which is typically called by init(8). Each line specifies one name space operation. Spaces and tabs separate arguments to operations; no
quotes or escapes are recognized. Blank lines and lines with # as the first non-space character are ignored. Environment variables of the
form $name are expanded within arguments, where name is a UTF string terminated by white space, a /, or a $.
The known operations and their arguments are:
mount [-abc] servename old [spec]
Mount servename on old.
bind [-abc] new old
Bind new on old.
import [-abc] host "[remotepath]mountpoint
Import remotepath from machine server and attach it to mountpoint.
cd dir Change the working directory to dir.
The options for bind, mount, and import are interpreted as in bind(1) and import(4).
SEE ALSO bind(1), namespace(4), init(8)NAMESPACE(6)