04-11-2007
Substitution not working in ksh
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[4]: logname=${fname/.dmp/.log}: 0403-011 The specified substitution is not valid for this command."
Thanks & Regards
Sheshadri
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. AIX
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 is not... (2 Replies)
Discussion started by: arsheshadri
2 Replies
4. Shell Programming and Scripting
Hi
I have a variable whose value is like this
i=/test/test1/test2/myfile.cd.070505123457
i would like to have the value of myfile.cd stored into another variable
my attempt is
test=${i##*/} ;echo $test ##and i get
myfile.cd.070505123457
since what i wnat is myfile.cd i try this... (19 Replies)
Discussion started by: xiamin
19 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,
i created a shell script having the following content:
#! /usr/bin/ksh
FROM="myemail@domain.com"
MAILTO="someemail@domain"
SUBJECT="TEST"
BODY="/export/home/adshocker/body.txt"
ATTACH="/export/home/adshocker/attach.prog"
echo $ATTACH
ATTACH_NAME="${ATTACH##*/}"
echo $ATTACH_NAME... (5 Replies)
Discussion started by: adshocker
5 Replies
7. Shell Programming and Scripting
Hello,
In bash I can use the following:
TMP=12345
MID=${TMP:1:1}
the expected result is: 2
but when using KSH I'm getting a ''bad substitution" error.
What is the correct syntaxin ksh?
Thanks (2 Replies)
Discussion started by: LiorAmitai
2 Replies
8. Shell Programming and Scripting
I'm trying to do an ls from inside of a ksh script. I loop through the results one line at a time and attempt to do a substitution using sed to convert YYYYMMDD from the older files into the newer files. Basically sometimes the ETL load runs over midnight and half the files are off by one day... (3 Replies)
Discussion started by: Calbrenar
3 Replies
9. Shell Programming and Scripting
Hi Gurus,
Not able to catch what's going wrong here. I just want to get output as "tree".
server:/mk/app/nexapp $ echo $SHELL
/usr/bin/ksh
server:/mk/app/nexapp $ export db_name1="tree"
server:/mk/app/nexapp $ export i=1
1st try:
server:/mk/app/nexapp $ echo $(db_name$i)
ksh: db_name1: ... (3 Replies)
Discussion started by: mukesh.lalwani
3 Replies
10. Shell Programming and Scripting
I am trying add a prefix variable(string) to command output.
sed parameter substitution is not working.
- I have found some issues on my end of testing,, please delete this thread for now. (1 Reply)
Discussion started by: kchinnam
1 Replies
LEARN ABOUT CENTOS
jfs_logdump
jfs_logdump(8) JFS utility - journal log dump jfs_logdump(8)
NAME
jfs_logdump - dump a JFS formatted device's journal log
SYNOPSIS
jfs_logdump [ -a ] device
DESCRIPTION
jfs_logdump dumps the contents of the journal log from the specified JFS formatted device into output file ./jfslog.dmp.
device is the special file name corresponding to the actual device from which the journal log will be dumped (e.g. /dev/hdb1 ).
jfs_logdump must be run as root.
OPTIONS
-a Dump the entire contents of the journal log instead of just the committed transactions since the last synch point.
EXAMPLE
Dump the entire JFS journal log from the 3rd partition of the 2nd hard disk into ./jfslog.dmp:
jfs_logdump -a /dev/hdb3
REPORTING BUGS
If you find a bug in JFS or jfs_logdump, please report it via the bug tracking system ("Report Bugs" section) of the JFS project web site:
http://jfs.sourceforge.net/
Please send as much pertinent information as possible, including any jfs_logdump error messages and the complete output of running jfs_fsck
with the -v option on the JFS device.
SEE ALSO
jfs_fsck(8), jfs_mkfs(8), jfs_fscklog(8), jfs_tune(8), jfs_debugfs(8)
AUTHORS
Barry Arndt (barndt@us.ibm.com)
William Braswell, Jr.
jfs_logdump is maintained by IBM.
See the JFS project web site for more details:
http://jfs.sourceforge.net/
October 29, 2002 jfs_logdump(8)