sorry...I should have included that...below is the code I used
#!/bin/ksh
file='btpy30'
read first junk < ${file}
typeset -l suffix="${first#${first%?}}"
cp "${file}" "${file}${suffix}"
Thanks so much Vlad for your solution..
It works except I am getting this error message....
copy[4]: -: This is not an identifier.
Can the "-" be replaced by another character? Also, is there any way to write the substring character in lower case...thanks again..
I am not able to get substring syntax using awk to work in my UNIX script (using IBM AIX and Korn Shell). I want to look at the first record from my data files and then copy the data file to a new file name based on a string in the first record. In the example (first record from data file)...
I am not able to get substring syntax using awk to work in my UNIX script. I want to look at the first record from my data files and then copy the data file to a new file name based on a string in the first record. In the example (first record from data file) below the data file is called...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.