Check detect file has renamed and PID

Check detect file has renamed and PID

Check detect file has renamed and PID
We have to print, Check detect file which has renamed and have PID

#!/bin/bash

if [ $# -lt 1 ]; then
echo "Usage: $0 dir"
exit 1
fi
if [ -d $1 ]; then
echo -e "Folder Content Before Modification\n"
list=`find "$1" -maxdepth 1 -type f `
tput bold
echo $list | tr " " "\n"
tput sgr0
arr=("$list")
for i in $arr; do
name=`echo $i | cut -d "." -f1`
mv $i "$name".$$
done
echo -e "\nFolder Content After Modification"
tput bold
find "$1" -maxdepth 1 -type f
tput sgr0
fi

For more programs in shell, visit our Shell Coder Archives

check detect file

All rights reserved. No part of this Post may be copied, distributed, or transmitted in any form or by any means, without prior written permission of website admin, except in case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to owner, addressed “Attention: Permissions Coordinator,” to the admin @coderinme

A web developer(Front end and Back end), and DBA at csdamu.com. Currently working as Salesforce Developer @ Tech Matrix IT Consulting Private Limited. Check me @about.me/s.saifi

Leave a reply:

Your email address will not be published.