![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| AWK substitution | klut | Shell Programming and Scripting | 4 | 01-15-2008 08:26 AM |
| Formatting Substitution Command Not Working in vi | ERPKEN | UNIX for Advanced & Expert Users | 11 | 05-06-2007 06:36 PM |
| Substitution not working in ksh | arsheshadri | SUN Solaris | 3 | 04-12-2007 08:20 PM |
| Bad Substitution | D_Redd74 | Shell Programming and Scripting | 3 | 02-07-2007 02:48 PM |
| Var substitution in awk - not working as expected | videsh77 | Shell Programming and Scripting | 3 | 01-13-2006 10:57 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Substitution not working in ksh
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Quote:
Code:
#!/bin/ksh
fname="EOA.dmp"
echo $fname
logname="${fname}/.dmp/.log"
echo $logname
|
|
#3
|
||||
|
||||
|
The code posted is valid for ksh93, as stated in the duplicate post here.
Anyway, fork yourself a process and save all this hassling about if you must use ksh88: logname=$( echo ${fname} | sed 's/\.dmp$/\.log/' ) Cheers ZB P.S. Thread closed. No duplicate/cross-posting. Read the rules. |
||||
| Google The UNIX and Linux Forums |