I have the following bash script lines in a file named test.sh.
Code:
#!/bin/bash
#
# Write Date to cron.log
#
echo "Begin SSI Load $(date +%d%b%y_%T)"
#
# Get the latest rates file for processing.
#
d=$(ls -tr /rms/data/ssi | grep -v "processed" | tail -n 1)
filename=$d
export filename
echo "The file name is $filename."
When I execute ./test.sh
Hi
I have written below script to get the data in table form.
Code:
#!/bin/sh
echo "File Name\tType"
for i in *;
do
echo "$i\t\c"
if [ -d $i ]; then
echo "directory"
elif [ -h $i ]; then
echo "symbolic link"
elif [ -f $i ]; then
echo "file"
else
echo "unknown"
fi
done
however i am getting output in different way .
Hi, I'm new to programming in shell and I wanted to make a simple database on shell script but I'm having trouble in deleting data. I would apreciate any kind of help. Thank you in adavanced.
Greetings.
I have a script that purges files from a folder and I would like a record (log file) of what files were purged.
I wrote the following snippet and it works when executing it from the command line:
Code:
LOGFILE="/path/to/logfiles/purge-folder.log"
echo "`date +%Y-%m-%d_%H:%M:%S` - Script started." >> ${LOGFILE}
for file in "/path/to/folder/*.txt&quo
Hi we are using AIX 5.3 64bit
I have near about 79000 log file having naming convention like "IFTMBCSun Aug 14 07:45:00 PAKST 2011".
This naming convention was created by a script error, now we need to rename these log file by removing extar spaces and (:) colon for that we wrote below script
Code:
ls * | while read file
do
echo $file
echo "$file" | sed "s/[ \:]//g&qu
hello
I have write one script which calculate result of student and takes input from file named "student.txt". This file has filed name rollno, name, mark1,mark2 and mark3.
My problem is that i want percentage with 2 floating point. I have write whole shell script but it can't work.
The file is located under appl/batchdata/
file name: storesales.txt
I am using following code because uuencode is not present.
Hello all,
I am currently writing a script to send files to a server over sftp.
Hello,
This may be a simple one, but i can't see what the issue is.
When i run the script via CLI, then i get the correct output via the if statement, but when i run via CRON i get the wrong statement.
Code:
echo " Checking Job Status" >> $DIR/Bpimagecleanup_$DATE
JOB_STATUS=`/usr/openv/netbackup/bin/admincmd/bpdbjobs | grep -i image | awk 'NR==1{print $4}'`
echo