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 .
I'm trying to create a Bash script which will move files to the trash, basically something that does the same thing as "kioclient move file1 file2 file3 trash:/" but more easily.
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
I wanted to create a script for batch file renaming
if I run the following from the command line
Code:
for i in *.docx; do mv "$i" "`echo $i | sed "s/%/_/g"`"; done
it works....but when I create a script file name rename.bash with the following code:
Code:
#!/bin/bash
for i in *.docx
do
mv "$i" "'echo $i | sed &q
Hello,
I have a script which is sending an html file as an attachment.
#!/usr/bin/ksh
export MAILTO="user@company.com"
export CONTENT="/usr/tmp/file.html"
export SUBJECT="EmailSubject"
(
echo "Subject: $SUBJECT"
echo "MIME-Version: 1.0"
echo "Content-Type: text/html"
echo "Content-Disposition: inline"
cat $CONTENT
) | /
Hello all,
I am currently writing a script to send files to a server over sftp.
hello,
I'm writing a php script in fedora to run with a csv file. I want the script to read column 4 and multiply each single line in the column by 1000, how would that script look?
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 group,
I am very beginner in shell scripting and self learning.
I am trying to create and executable script to run awk from user defined variables.
e.g. suppose from a given file I want to delete some rows or some columns
We need to repeat this process for many files. Thus I was trying to write a script. Any help will be really great.