Skip to content

Tag: ksh

If grep value not found return an echo [korn shell]

I have an issue with this script. What I’m trying to do is there are 3 conditions: 1- i put a valid input that is found inside the file and it gives me the output 2- I put a wrong input that can’t be found inside the file and give me an output of “Value not Found” 3- I don’t

Split string in ksh

I got a string as follow : What would be the best way to convert it in seconds without using date ? I tried something like this that sounded pretty nice but no luck : Any idea is welcome, I just can’t use date -d to make conversion as it is not present on the system I am working on.

Split file into multiple when special char met

I have a main file as following : My final goal is to create a file that will containt only block that contains a specific string, for example if that string would be lines then I would have an output file like this : To reach my objective, I first try to split my main file into subfiles by bock

empty an existing array in ksh

I have script which stores the list of files in an array as shown below I have to empty this my_array variable to use it for other purpose. I cannot declare another new array. Is there any way to clear the content of the array and reuse it again? Thanks in advance. Answer Since you’re already using set …