Tag Archives: Shell

My Shell Script Usage Collection

sgadmin created the topic: My Shell Script Usage Collection Count Total number of files in Directory and Subdirectory > find . -type f | wc –l Count Specific extention files in Directory and Subdirectory > find . -type f -name \*.mnp |wc –l Count only Directory > find . -type d | wc –l

Shell script to run x times

rajeshkumar created the topic: shell script to run x times Problem: First i need to cd to this directory $SWDIR/util Second i need to run the following either 4 times or 20 times ./swadm add_process 1 BG Y how can i put this in a script Regards, Rajesh Kumar Twitt me @ twitter.com/RajeshKumarIn rajeshkumar replied… Read More »

Whats the difference between running a shell scrip

scmuser created the topic: Whats the difference between running a shell scrip Whats the difference between running a shell script as ./script.sh and sh script.sh have a script that looks like this #!/bin/bash function something() { echo “hello world!!” } something | tee logfile I have set the execute permission on this file and when… Read More »

Shell script merge two list and remove duplicates

rajeshkumar created the topic: shell script merge two list and remove duplicates You want all the records from list_A supplemented by all the records from list_B for which there is not already a matching name in list A. Mathematically this is: A + B – {w in B | (w,value) in A } \ There… Read More »

Shell script for recursive delete required.

rajeshkumar created the topic: Shell script for recursive delete required. #!/bin/bash if [ $# -ne 1 -o ! -d “$1” ] then echo “Usage $0 dirname” exit 1 fi find “$1” -type f -print | while read file do dir=$(dirname “$file”) dname=$(basename “$dir”) fname=$(basename “$file”) [ “$dname” = “$fname” ] && rm “$file” done Regards,… Read More »

Shell Script to delete a folder that is more then

scmuser created the topic: Shell Script to delete a folder that is more then Shell Script to delete a folder that is more then 1 week old Hi all, i have this scritp set -x cd /var/log/ direc=”bkp_`date +%F`” mkdir $direc cp /var/log/*.log /tmp/bkp. — Here im ok, what i need is a scritp to… Read More »

Shell Script Run in Background

rajeshkumar created the topic: shell script run in background I wanted to run a particular shell program in a background and it should not be dependent on terminal session of putty or telnet? Just finding solution? Regards, Rajesh Kumar Twitt me @ twitter.com/RajeshKumarIn rajeshkumar replied the topic: Re:shell script run in background i found 2… Read More »

How to Restore The Dump File using Shell Scripting

scmuser created the topic: how to restore the dump file using shell scripting I have created a script file to dump the application files using the following script Code ============= #!/bin/bash #Full Day Backup Script #application folders backup now=$(date +”%d-%m-%Y”) #use 1 instead of 0 which is incremental backup dump -0f $now /var/www/html/* ============= using… Read More »

Shell Script to Find All New Files Added

scmuser created the topic: shell script to find all new files added Hi, i am looking for a shell script to find all new files added or modified after a certain date & Time?? Any help? mnanjala replied the topic: Re:shell script to find all new files added This should solve the problem find .… Read More »

Shell Script Program 1

scmuser created the topic: shell script program 1 Device a script that takes a filename as argument ( which must exist in the current directory) and locates from your home directory tree all path names of its links. The list should be mailed to self