Substring operation in kshell

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Substring operation in kshell
# 1  
Old 09-24-2009
Question Substring operation in kshell

Please let me know how to perform the substring operation in kshell.
If i have line like below

i would like to retrieve the position 7 to 19, how to do this in kshell?
# 2  
Old 09-24-2009
$ echo 238923893282389034893489458945904589045454903490 | cut -c7-19

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Please help with Kshell Script!

I am an AIX noobie, and have a question around an AIX 5.2 script that I need to run. Security Audit requires us to have no World Writable files on our server, but every time we restart the Domino server on AIX it re-flags two files as World Writable. I have a little script that I created that... (5 Replies)
Discussion started by: Nebs
5 Replies

2. UNIX for Dummies Questions & Answers

Passing variable to Alias in Hp kshell

Hi all, I have a series of directories which i open regularly. I want create an alias so that i can pass the direcotry name to alias and then this commands makes Cd to the path i need. COuld you please help on how to create an alias ex of what i am trying but couldn't succeeded #alias... (1 Reply)
Discussion started by: firestar
1 Replies

3. Shell Programming and Scripting

Column operation : cosne and sine operation

I have a txt file with several columns and i want to peform an operation on two columns and output it to a new txt file . file.txt 900.00000 1 1 1 500.00000 500.00000 100000.000 4 4 1.45257346E-07 899.10834 ... (4 Replies)
Discussion started by: shashi792
4 Replies

4. Linux

how to insert a title into a window in kshell

hi all, i am using a Ubuntu work station. i have following piece of code that works ok. But i cant figure out a way to insert a string call $Name into the title of the window i am opening. As you can see, i tried two different ways without a success. Can someone please help me out here? :( ... (3 Replies)
Discussion started by: usustarr
3 Replies

5. Shell Programming and Scripting

KShell regular expresion

Hi, I would like to know if the parameter i am passing to a shell script is contain the following charachter : ASM. I belive that i should use regular expresion here. Can one help ? Bellow is the "if statment" i need to fix with the reg exp: if ; then #echo "IT IS AN RDBMS... (4 Replies)
Discussion started by: yoavbe
4 Replies

6. Shell Programming and Scripting

How to see a variable value outside a function in kshell

Hi, I wrote a small shell script which had function C_fun() and script name is same C_fun.ksh Here is the program inside the script #!bin/ksh -x C_fun() { typeset TEXT=${1} } echo Value of TEXT $TEXT When Im running the above script with Parameter "R" as the option .... (6 Replies)
Discussion started by: somu_june
6 Replies

7. Shell Programming and Scripting

sed command for substring operation

Hi All, Input=abcDEF_1.6k1 I need to use ‘sed' command to get 1.6 value and store to some variable from the given input. Please help me in getting the command. Regards, Kalai (2 Replies)
Discussion started by: kalpeer
2 Replies

8. Shell Programming and Scripting

running .sh script in kshell

hi i wrote a script in shell script(, now i need to run the script in korn shell. could anyone explain how to run the same script korn shell. thanks in advance Satya (2 Replies)
Discussion started by: Satyak
2 Replies

9. UNIX for Dummies Questions & Answers

kshell variables and awk

Hi, Is it possible to initialise a shell variable and set it to a value from an awk command? i.e. #set myvalue = to the first 8 charachters of the line that begins with 0 myvalue = awk '/^0/ {substr($0,1,8)}' myvaluefile or even declare a variable, then reinitialise it as part of the... (1 Reply)
Discussion started by: kshelluser
1 Replies

10. AIX

Kshell scripts and timing

Hello everyone, I have a script thats acting funky, what I would like to do is report to a file, how long its taking to get to certain area's, in seconds. For example. -- Start timer -- Run unix command 1 -- Run unix command 2 -- Stop timer -- Report Seconds -- etc etc Is there a way... (3 Replies)
Discussion started by: dbridle
3 Replies
Login or Register to Ask a Question