UrbanPro
true

Learn Unix Shell Scripting Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Learn Unix Shell Scripting Training with Free Lessons & Tips

Ask a Question

Post a Lesson

All

All

Lessons

Discussion

Lesson Posted on 03/03/2021 Learn Unix Shell Scripting Training

Unix (Automation for Disk space Alert on Server using Shell Script)

Umesh Prasad

I am having 10+ years of vast experience in Python, Unix ,Linux ,Shell Scripting and Perl Scripting.I...

disk_check_advance.sh#!/bin/kshvar=`df -a|grep home|tail -1|awk '{print $3}'`HOST=`hostname`echo $var1if ; then df -h|grep home >data# du -s /home/* 2>/dev/null| sort -rn |head -20>>data # cat data| # mail -s "Alert: Almost out of disk space on $HOST" umesh.prasad@fedex.com while read line;... read more

disk_check_advance.sh
#!/bin/ksh
var=`df -a|grep home|tail -1|awk '{print $3}'`
HOST=`hostname`
echo $var1
if [ $var -le 3000000 ]; then
df -h|grep home >data
# du -s /home/* 2>/dev/null| sort -rn |head -20>>data
# cat data|
# mail -s "Alert: Almost out of disk space on $HOST" umesh.prasad@fedex.com
while read line; do

ED=`echo $line|cut -d "/" -f3`
ID=`echo $line|cut -d "/" -f3|cut -c1`

if [ "$ID" == "f" ]
then

ID1=`echo $ED|cut -c2-`
`echo $line | mail -s "Alert:Almost out of Disk space on $HOST" $ID1@fedex.com`
else
ID1=`echo $ED|cut -c3-`
`echo $line | mail -s "Alert:Almost out of Disk space on $HOST" $ID1@fedex.com`
fi
done < data
fi

read less
Comments
Dislike Bookmark

Answered on 03 May Learn Unix Shell Scripting Training +3 UNIX Certification Unix Unix Shell programming

Deepika Agrawal

"Balancing minds, one ledger at a time." "Counting on expertise to balance your knowledge."

Microsoft Windows is an operating system that features a graphical user interface and compatibility with a wide range of hardware and software, primarily for personal computers. UNIX is a multitasking, multi-user operating system developed for workstations, servers, and other devices read more

Microsoft Windows is an operating system that features a graphical user interface and compatibility with a wide range of hardware and software, primarily for personal computers. UNIX is a multitasking, multi-user operating system developed for workstations, servers, and other devices

read less
Answers 1 Comments
Dislike Bookmark

Answered on 16 May Learn Unix Shell Scripting Training +3 UNIX Certification Unix Unix Shell programming

Pranjal B.

There are several interesting projects based on Unix/Linux that involve shell scripting. Here are a few ideas:System Monitoring Tool,Backup Automation,Log Analysis Tool,File Management Utility,System Configuration Management,Network Services Automation,and etc...
Answers 2 Comments 1
Dislike Bookmark

Learn Unix Shell Scripting Training from the Best Tutors

  • Affordable fees
  • Flexible Timings
  • Choose between 1-1 and Group class
  • Verified Tutors

Answered on 02 May Learn Unix Shell Scripting Training +3 UNIX Certification Unix Unix Shell programming

Deepika Agrawal

"Balancing minds, one ledger at a time." "Counting on expertise to balance your knowledge."

Windows Terminal is a multi-tabbed terminal emulator developed by Microsoft for Windows 10 and later as a replacement for Windows Console. It can run any command-line app in a separate tab.
Answers 1 Comments
Dislike Bookmark

Answered on 02 May Learn Unix Shell Scripting Training +3 UNIX Certification Unix Unix Shell programming

Deepika Agrawal

"Balancing minds, one ledger at a time." "Counting on expertise to balance your knowledge."

Echo is a Unix/Linux command tool used for displaying lines of text or string which are passed as arguments on the command line. This is one of the basic command in linux and most commonly used in shell scripts. In this tutorial, we will look at the different options of echo command. read more

Echo is a Unix/Linux command tool used for displaying lines of text or string which are passed as arguments on the command line. This is one of the basic command in linux and most commonly used in shell scripts. In this tutorial, we will look at the different options of echo command.

read less
Answers 1 Comments
Dislike Bookmark

Answered on 02 May Learn Unix Shell Scripting Training +3 UNIX Certification Unix Unix Shell programming

Deepika Agrawal

"Balancing minds, one ledger at a time." "Counting on expertise to balance your knowledge."

Shell scripting is primarily used to automate repetitive system tasks, such as backing up files, monitoring system resources, and managing user accounts. By turning a series of commands into a script, system administrators can save time, increase accuracy, and simplify complex tasks. read more

Shell scripting is primarily used to automate repetitive system tasks, such as backing up files, monitoring system resources, and managing user accounts. By turning a series of commands into a script, system administrators can save time, increase accuracy, and simplify complex tasks.

read less
Answers 1 Comments
Dislike Bookmark

Learn Unix Shell Scripting Training from the Best Tutors

  • Affordable fees
  • Flexible Timings
  • Choose between 1-1 and Group class
  • Verified Tutors

Answered on 02 May Learn Unix Shell Scripting Training +3 UNIX Certification Unix Unix Shell programming

Deepika Agrawal

"Balancing minds, one ledger at a time." "Counting on expertise to balance your knowledge."

Because of its open-source status, adaptability, control, and reliability, Linux is a preferred operating system among ethical hackers. For hacking and penetration testing, Linux provides a wide range of tools and applications. Its command-line interface makes difficult and automated tasks simpler. read more

Because of its open-source status, adaptability, control, and reliability, Linux is a preferred operating system among ethical hackers. For hacking and penetration testing, Linux provides a wide range of tools and applications. Its command-line interface makes difficult and automated tasks simpler.

read less
Answers 1 Comments
Dislike Bookmark

Answered on 02 May Learn Unix Shell Scripting Training +3 UNIX Certification Unix Unix Shell programming

Deepika Agrawal

"Balancing minds, one ledger at a time." "Counting on expertise to balance your knowledge."

Shell is a generic term for a command line interpreter. On Unix/Linux there are many of them you can choose: sh, bash, csh, ksh, zsh etc, all slightly or substantially different. To get a feel for how they differ and which one you might like best, read several of the manual pages.
Answers 1 Comments
Dislike Bookmark

Answered on 02 May Learn Unix Shell Scripting Training +3 UNIX Certification Unix Unix Shell programming

Deepika Agrawal

"Balancing minds, one ledger at a time." "Counting on expertise to balance your knowledge."

I have a bash application that is producing some result, and I'd like to echo the result to either stdout or to a user chosen file. Because I also echo other interactive messages going to the screen, requiring the user to explicitly use the > redirection when he wants to echo the result to a file... read more

I have a bash application that is producing some result, and I'd like to echo the result to either stdout or to a user chosen file. Because I also echo other interactive messages going to the screen, requiring the user to explicitly use the > redirection when he wants to echo the result to a file is not an option (*), as those messages would also appear in the file.

Right now I have a solution, but it's ugly.

if [ -z $outfile ]
then
    echo "$outbuf"    # Write output buffer to the screen (stdout)
else
    echo "$outbuf" > $outfile  # Write output buffer to file
fi

I tried to have the variable $outfile to be equal to stdout, to &1 and perhaps something else but it would just write to file having that name and not actually to stdout. Is there a more elegant solution?

(*) I could cheat and use stderr for that purpose, but I think it's also quite ugly, isn't it?

read less
Answers 1 Comments
Dislike Bookmark

Learn Unix Shell Scripting Training from the Best Tutors

  • Affordable fees
  • Flexible Timings
  • Choose between 1-1 and Group class
  • Verified Tutors

Answered on 01 May Learn Unix Shell Scripting Training +3 UNIX Certification Unix Unix Shell programming

Deepika Agrawal

"Balancing minds, one ledger at a time." "Counting on expertise to balance your knowledge."

The ps command writes the status of active processes and if the -m flag is given, displays the associated kernel threads to standard output. While the -m flag displays threads associated with processes using extra lines, you must use the -o flag with the THREAD field specifier to display extra thread-related... read more

The ps command writes the status of active processes and if the -m flag is given, displays the associated kernel threads to standard output. While the -m flag displays threads associated with processes using extra lines, you must use the -o flag with the THREAD field specifier to display extra thread-related columns.

read less
Answers 1 Comments
Dislike Bookmark

About UrbanPro

UrbanPro.com helps you to connect with the best Unix Shell Scripting Training classes in India. Post Your Requirement today and get connected.

Overview

Questions 316

Total Shares  

+ Follow 6,615 Followers

Top Contributors

Connect with Expert Tutors & Institutes for Unix Shell Scripting Training

x

Ask a Question

Please enter your Question

Please select a Tag

X

Looking for Unix Shell Scripting Training Classes?

The best tutors for Unix Shell Scripting Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Unix Shell Scripting Training with the Best Tutors

The best Tutors for Unix Shell Scripting Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more