10-17-2011
well that was painless. I thought you needed the ` to run a command. Thanks!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I thought it was possible to use several time a #! entry on a script but it doesn't seems to work. My need is to have a part of a ksh script without substitution so it would look like
#!/bin/ksh
--
first part
---
#!/bin/ksh -f
--
part without substitution
--
#!/bin/ksh
--... (2 Replies)
Discussion started by: solea
2 Replies
2. Shell Programming and Scripting
Hi folks
Please let me know if anyone knows how to handle this.
My KSH script -> testscript.ksh
cmd=$1
ENV="devl"
echo $cmd
This is how I call the script
./testscript.ksh 'ps -ef | grep br$ENV'
How do I get this to print the below text i.e $ENV should be substituted with the value... (5 Replies)
Discussion started by: tipsy
5 Replies
3. Solaris
Hi,
Following code is working in bash but not in ksh.
Can someone please send me an alternative?
#!/bin/ksh
fname="EOA.dmp"
echo $fname
logname=${fname/.dmp/.log}
echo $logname
I am getting below error in ksh
"testcmd: logname=${fname/.dmp/.log}: 0403-011 The specified substitution... (3 Replies)
Discussion started by: arsheshadri
3 Replies
4. Shell Programming and Scripting
What I'm trying to do is perform a copy, well a ditto actually, on the results of a find command, but some inline string substitution needs to happen.
So if I run this code find ./ -name "*.tif" I get back these results.
.//1234567.tif
.//abcdefg.tif
Now the action from exec or xargs I... (2 Replies)
Discussion started by: myndcraft
2 Replies
5. Shell Programming and Scripting
Hi
I have a variable BIT1 which holds some value. Is there a way to retrieve the value of this variable indirectly via another variable, lets say SUBSET_BIT_NUM=1, so the call will look something like this:
sundev1 $ echo ${BIT${SUBSET_BIT_NUM}}
ksh: ${BIT${SUBSET_BIT_NUM}}: bad substitution
... (3 Replies)
Discussion started by: aoussenko
3 Replies
6. Shell Programming and Scripting
Hi Gurus,
I am working with a korn shell script. I should replace in a very great file the character ";" with a space.
Example:
2750;~
2734;~
2778;~
2751;~
2751;~
2752;~
what the fastest method is? Sed? Awk?
Speed is dead main point, Seen the dimensions of the files
Thanks (6 Replies)
Discussion started by: GERMANICO
6 Replies
7. Shell Programming and Scripting
Dear Friends,
Please let me know how to use the date command inside the substitution flag replacement string.
echo "01 Jan 2003:11:00:06 +0100" | sed 's/\(.*\)/`date -d \1 "+%Y%m%d%H%M%S"`/'
I want to supply \1 string to Here mention below as part of replacement string,
date -d <Here>... (5 Replies)
Discussion started by: tamil.pamaran
5 Replies
8. UNIX for Dummies Questions & Answers
Hello people.
Part of my script:
SUBSETID=`echo $PMFILE |sed 's/pmresult_//' | sed 's/_*//'`
MAPFILE=`find /huawei/cell /huawei/nodeb /huawei/rnc -name 'mapping_$SUBSETID.txt' |grep -v backup`
Unfortunatelly variable $SUBSETID in the MAPFILE declaration will not return the... (3 Replies)
Discussion started by: drbiloukos
3 Replies
9. Shell Programming and Scripting
Hello all. This is my first post/question on this site.
I’m a new Systems Analyst with previous experience with BASH. Although now I'm using AIX, and I’m trying to get a feel for the Korn shell (for those of you that don’t know AIX only uses the KORN shell).
I hope I put this into the correct... (10 Replies)
Discussion started by: sydox
10 Replies
10. Shell Programming and Scripting
Hi,
I am a bit confused ,why would a sed command work fine outside of ksh script but not inside.
e.g
I want to replace all the characters which end with a value and have space at end of it.
so my command for it is :
sed -i "s/$SEPARATOR /$SEPARATOR/g" file_name
This is working fine in... (8 Replies)
Discussion started by: vital_parsley
8 Replies
LEARN ABOUT DEBIAN
mdm-run
MDM-RUN(1) User Commands MDM-RUN(1)
NAME
mdm-run - run a command in parallel with mdm-master
SYNOPSIS
mdm-run command
mdm-sync command
DESCRIPTION
mdm-run annotates command as a candidate for parallel execution. If an mdm-master process is present (i.e., the environment variable
MDM_CMD_SOCK is defined), mdm-run submits command to the mdm-master, and it exits when the master issues the command to an mdm-slave
process (which may be connected to another terminal) for execution. mdm-sync runs command in place, but it coordinates with mdm-master to
ensure that executing command does not interfere with commands that are currently executing in parallel.
If there is no mdm-master process present (i.e., the environment variable MDM_CMD_SOCK is not defined), both mdm-run and mdm-sync simply
run command as if you entered command all by itself.
These programs are a part of the Middleman System (mdm).
OPTIONS
Neither mdm-run nor mdm-sync accepts any options.
EXIT STATUS
If there is no mdm-master process present, the exit status of mdm-run is the exit status of command. If an mdm-master process is present,
the exit status is 0 if and only if command is successfully issued to an mdm-slave process for execution.
The exit status of mdm-sync is always the exit status of command.
ENVIRONMENT
The mdm system uses the following environment variable for internal communication, and thus you should not try to set them yourself.
MDM_CMD_SOCK
mdm-run uses this environment variable to decide whether a mdm-master process is present.
EXAMPLE
See mdm.screen(1) for an example use of mdm-run.
SEE ALSO
mdm.screen(1)
Linux 2009-03-06 MDM-RUN(1)