10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all
Below code works in bash but it is not working in ksh.
enddate=`date -d "$enddate + $i day" "+%Y_%m_%d"`
Please help me how it works in ksh
Thanks (10 Replies)
Discussion started by: pmreddy
10 Replies
2. Shell Programming and Scripting
Dear All,
I have a script as follows:
1 #! /bin/ksh
2 #
28 varDate=`date +%d%h%y`
29 export spool_file=/app/my_user/work/TH_Status_${varDate}_Check.txt
30
31 #########################
32 # Unix Code Starts here #
33 #########################
... (3 Replies)
Discussion started by: saps19
3 Replies
3. Shell Programming and Scripting
Hi,
Below is the code for my script
#!/bin/ksh
for file in "file1.txt" "file2.txt" "file3.txt" "file4.txt"
do
L="$(tail -1 $file)"
NUM=${L%%|*}
DAT=${L##*|}
echo $NUM
echo $DAT
done
Now here,suppose for file1.txt
L will have data like 56|06-07-2010
So, it should be (7 Replies)
Discussion started by: fidelis
7 Replies
4. Shell Programming and Scripting
I am having a problem with this command working, can anyond help?
$ export Path=/user/bin user/local/bin /user/ucb/bin (2 Replies)
Discussion started by: vthokiefan
2 Replies
5. Shell Programming and Scripting
Hi,
trying this
===============================
Temp=`sqlplus -s user/passwd <<EOF
WHENEVER SQLERROR EXIT 1
set serverout on
set feedback off
set heading off
select nam from tabel1
where x=y;
EOF`
echo Temp>>$logfile
=================================
The select statement is... (2 Replies)
Discussion started by: amitkr
2 Replies
6. Shell Programming and Scripting
On a SUN cluster (ksh - Solaris 8 SPARC) I run a script which at some time has to perform a rsh command on the alternate node but with some other user (let's say "oper") so it should be like:
rsh su - oper -c APP_COMMAND -paramters
When I run the script APP_COMMAND is done but without taking... (2 Replies)
Discussion started by: heartwork
2 Replies
7. Shell Programming and Scripting
Hi all,
I want to find out last word in each line ...
suppose my file contains following lines ...
this is unix forum
here we share knowledge
it is very interactive
Now i need the output as :- ( the last word od each line )
forum
knowledge
interactive
... (2 Replies)
Discussion started by: dhananjayk
2 Replies
8. Shell Programming and Scripting
in my script i have a command which will sum a particular value of all the lines in a file not beginning with H or T .
I have given the following commands
-------------------------------------------------------------
RCRD_CTRL_VAL_1_SUM=`awk '/^/{... (6 Replies)
Discussion started by: asinha63
6 Replies
9. Shell Programming and Scripting
I'm trying to run a ksh script with a case condition to handle parameters.
#!/bin/ksh
db_start(){
*code
}
db_shut(){
*code
}
case "$1" in
up)
db_start TRNG
;;
down)
db_shut TRNG
;;
*)
echo "Usage: $0 { up | down }" (3 Replies)
Discussion started by: digiteck
3 Replies
10. Shell Programming and Scripting
when declaring a variable e.g.
export DAYS
what checking / how can i check that the value assigned only contains numeric characters or integers ? (1 Reply)
Discussion started by: jinky
1 Replies