I want to write something like this in a korn shell script
if [ "_$ClientBox" = "_" || "_$RecBox" = "_" || ("_$post1" = "_" && "_$post2" = "_") ]
This syntax gives an error. Please ...
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...
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=...
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...
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 ...
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.
I need to loop through a bunch of servers using isql. How do I store the server names in an array. And then loop through the array. Using isql I need to connect to the servers. After connectin...
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 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...
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...
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...
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...
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...
What is the ftp command to copy a file from local to remote machine?
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.
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 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...
How do I pattern match DL_XXX in a shell script. I want to ignore directories starting with DL
can I do somethign like
$dirName != "DL%"
result=`isql -Sservername -Uuser -Ppasswd<<EOF
set nocount on
go
select clientname from table
go
EOF`
clientFullName=`echo "${result}"|tail +3`
awk -F, '{print $1}' test.csv| while...
How do I pad a variable such that it has 4 characters padded with zero
e.g. 1 become 0001 18 become 0018 567 become 0567 and 7677 stays as it is (dont need to wory about more than 4 chara...
Ive got a large test file (around 3 Gb) and ned to parse it and whenever I find a particular label, add the corresponding value.
For example my file may contain
NAME hjhkjhdad
ADDRESS ...
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 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...
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...