Advertisement

635 organizations, including eBay, Ericsson and Lockheed Martin, now work smarter with Corporate Accounts. Save up to 42%

 

Welcome! If you have any general questions about Experts Exchange, feel free to ask me.

 
Time Tested ksh Solutions: 1 - 25 of 98
 
I want to write something like this in a korn shell script if [ "_$ClientBox" = "_" || "_$RecBox" = "_" ||  ("_$post1" = "_" && "_$post2" = "_")  ] This syntax gives an error. Please ...
OK.  I need help in unix scripting. I have attached a sample file.  Here are my queries. 1.     Read the text file line by line.  So there should be 5 lines to be read 2.     Find t.mgmt_sa_code=...
How do I send a file as attachment as an email to me and cc it to a list of people using UNIX mail/mailx command
I want to pass an array as argument to a shell script. And loop through the array within the script for processing. running the script: script.ksh array #!/bin/ksh for array do pr...
Hi ppl, I have this one line in my shell script that looks like this: x=`date +"%H"` ; echo $x ; while [ $x -lt 12 ] ; do ; x=`date +"%H"` ; done It makes sense to me but when I run i...
I have inherited some code that I need to understand. Ine of the conditions says: if [ condition ] then   ..something.. elfif [condition -a condition ] then  ... something else ... ...
Hi, I'm using a script to start my application on a daily basis. A cron-like application called Control-M calls this script at a give time and starts the app. The script istelf is very simp...
I am trying to develop a shell script on AIX 5.3.5 / ksh or ksh93, which will take a text file with fixed-length rows ('records'), and on each row replace certain characters, based on position...
IN a file I need to check for 3 patterns if all the 3 patterns are in the file. I need to send out an email. All this needs to be done in korn shell script. Please advise.
Store the fields of one record for all records of a variable length ascii file in variables in a Korn Shell script. For example, the format of the file is: field1, field2, field3, .. .field...
Hi, I need a script which shall purge folders which are older than 30 days from the current date. Hence for example if today is 08/22/2007 then anything which is before 07/23/2007 should ...
I am trying to write a korn shell script to easily create and setup a new website on my server. I've successfully got it to create all the directories and symbolic links that I want, but I'...
Hi Is there a way using TEE command to direct the stderr and the stdou  to a file.  Currently only the stdout is hitting my file with this command and the stderr is hitting the screen: c...
Hai !        This is my question. i have a file something like my_file_20080810.dat   now i need to look for the file in a folder and then grab the timestamp. cd directory_in_which_f...
What is the ftp command to copy a file from local to remote machine?
Everyone: Good afternoon.  If I wanted the first 4 characters of a string wouldn't I just: #!/usr/bin/ksh string=ABCDEJGHIJ snip=${string:0:4} echo $snip I can't seem to make the sni...
I want to write nested if statement in korn Shell script if then ---- elif then ---- within the elif I want to write another if statement else --- fi Please advise.
Hi, i have created a shell script (.ksh) the runs three queries(plsql). These three queries create three csv files which are saved in a directory called results. I need a way to check if thes...
I'm looking for a script that uses vmstat from cron on like a minute interval to capture processes that utilize 95%+ cpu load. I then need the minute outputs processed so that if any process i...
How do I parse a string and retrieve the last 3 digits and add 4 to the start of the 3 digits the string could be in following formats: customer100 cust100 I need to retrieve the las...
I have 4 columns in a file. in the fourth column I have something like janclient085, febclient 086. I need to just cut the fourth column from the file and extract the client085, client086 and...
I am writing a shell script which uses commands like ssh, scp. Whenever any command fails I want to exit out of the script with an exit status. Please advise how can I do that.
Hi, I have a requirement to split the file on different pattern and write to different files. My scripts doing the work properly but i am facing a strange problem. while writing to different...
How do I ssh in a ksh script? After doing ssh in the same code I need to do sudo su. All these commands need the password to be entered. Is there some way in the script that I could handle thi...
I want to loop thru all the sub directories within a directory using shell script. Please advise.