Ask Dave Taylor
  • Facebook
  • Instagram
  • Linkedin
  • Pinterest
  • Twitter
  • YouTube
  • Home
  • YouTube Videos
  • Top Categories
  • Subscribe via Email
  • Ask A Question
  • Meet Dave
  • Home
  • Linux Shell Script Programming (Page 5)

Linux Shell Script Programming

How many Friday the 13ths are there in a given year?

April 28, 2007 / Dave Taylor / Linux Shell Script Programming / 7 Comments
how many friday the 13th year

I’m studying Unix, and i need help writing a script. The script requires that it outputs the number of months and years from January 2007 to December 2017 inclusive that have a Friday the thirteenth.

View Answer »

Bug in shell script using awk to read /etc/passwd?

March 26, 2007 / Dave Taylor / Linux Shell Script Programming / 1 Comment

In your book Wicked Cool Shell Scripts, on p. 115, Script #40 Reporting Disk Hogs, on the 8th line the second part of the line reads:
    awk -F: ‘$2 > 99 {print $1} ‘)
I am very new to shell scripting, so I am probably just not understanding how this line should be interpreted. In my Linux class, I have been learning that in the /etc/passwed file the 1st field is username, the 2nd field is password (x), and the third field is the UID, so wouldn’t the $2 above really be $3 so that the script would be checking to see if the UID field, which is field 3 is greater that 99, not the password field,which is field 2? Please let me know, since this is confusing to me. Thanks for your help.

View Answer »

How do I turn a command line into a shell script?

February 6, 2007 / Dave Taylor / Linux Shell Script Programming / 2 Comments

I’ve been experimenting with mencoder to convert my AVI movies into a format that I can download onto my cellphone and finally found a site where they explain the various parameters needed for the mencoder program to get it to work. Problem is, they’re a pain to type in each time. How do I turn an ugly command line invocation into a nice shell script?

View Answer »

How do I compare float / real numbers in a shell script?

January 19, 2007 / Dave Taylor / Linux Shell Script Programming / 20 Comments

Hi i am trying to comapre numbers for the biggest among double type of numbers. For example: 0.254, 0.255, 0.564, 0.984, 0.556, 0.6566, and 0.5666.
I’m using the following script code:
if [ $max -lt $i ]
if [ “$max -lt “$i” ]
But they all give the error message “integer expression expected”. Help!

View Answer »

How can my shell script test to see if it’s already running?

October 27, 2006 / Dave Taylor / Linux Shell Script Programming / 5 Comments

I have a script that does an ftp from a SCO UNIX server to windows server to get files from the windows server. The script is set in the cron to run every xx minutes. Sometimes the script will hang and leave a process running. This can bog down the UNIX server. I want to be able to do two things. 1. I want to make sure that the script doesn’t hang – so it should terminate after xx minutes (the files are very small that it is getting). And 2. I want the script to test to make sure that it is not already running, before starting again. THANKS

View Answer »

How can I count executable binaries on my Linux box?

October 25, 2006 / Dave Taylor / Linux Shell Script Programming / 1 Comment

I’ve been looking at your script to count executable binaries in the book Wicked Cool Shell Scripts and I think that there’s a problem in the script. Specifically, what happens if I have a directory in my PATH more than once?

View Answer »

Can I create an Apache image directory browser script?

October 23, 2006 / Dave Taylor / HTML & Web Page Design, Linux Shell Script Programming / 3 Comments

I run a fairly busy Web site with a variety of different image directories. The problem is, Apache shows directories in a fairly rudimentary way which makes it quite difficult to find a specific image if I don’t remember its name. Is there a better way with some sort of shell scripting?

View Answer »

How can I time portions of a Linux shell script?

September 13, 2006 / Dave Taylor / Linux Shell Script Programming / 13 Comments

Just picked up your book Wicked Cool Shell Scripts and already have one quick question: While working on the startup scripts, I would like to place log timers at certain portions of scripts. Is it possible to log point A at he beginning of a section, do the processing, log point B at the end of the section and then log B minus A so I know exactly how long a section took to process?

View Answer »

«‹34567›»

Search

Recent Posts

  • How Do I Enable and Manage my iPhone Personal Hotspot?
  • How Can I Buy a Collectible NFT Avatar through Reddit?
  • Fix USB Flash Drives Not Opening on Insert in Windows?
  • What’s the Best Way to Update my Ubuntu Linux Desktop Wallpaper?
  • Can I Automatically Disable Macros in Microsoft Word?

On My YouTube Channel

Kensington Pro Video Conferencing System: Desktop -- DEMO & REVIEW

EKSA Star Engine E5000 Pro Gaming Headset -- REVIEW

Categories

  • AdSense, AdWords, and PPC Help (106)
  • Amazon, eBay, and Online Shopping Help, (161)
  • Android Help (200)
  • Apple iPad Help (145)
  • Apple Watch Help (52)
  • Articles, Tutorials, and Reviews (344)
  • Auto Tech Help (11)
  • Business Advice (199)
  • Chrome OS Help (24)
  • Computer & Internet Basics (763)
  • d) None of the Above (165)
  • Facebook Help (383)
  • Google, Chrome & Gmail Help (178)
  • HTML & Web Page Design (245)
  • Instagram Help (47)
  • iPhone & iOS Help (607)
  • iPod & MP3 Player Help (173)
  • Kindle & Nook Help (93)
  • LinkedIn Help (85)
  • Linux Help (165)
  • Linux Shell Script Programming (86)
  • Mac & MacOS Help (891)
  • Most Popular (16)
  • Outlook & Office 365 Help (26)
  • PayPal Help (69)
  • Pinterest Help (53)
  • Reddit Help (18)
  • SEO & Marketing (81)
  • Spam, Scams & Security (92)
  • Trade Show News & Updates (23)
  • Twitter Help (217)
  • Video Game Tips (66)
  • Web Site Traffic Tips (62)
  • Windows PC Help (918)
  • Wordpress Help (204)
  • Writing and Publishing (72)
  • YouTube Help (46)
  • YouTube Video Reviews (159)
  • Zoom, Skype & Video Chat Help (57)

Archives

Social Networks…

Ask Dave Taylor

Follow Me on Pinterest
Follow me on Twitter
Follow me on LinkedIn
Follow me on Instagram


AskDaveTaylor on Facebook

microsoft insider mvp


This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this site or on any linked site. Further, please note that by submitting a question or comment you're agreeing to our terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site. Our lawyer says "Thanks for your cooperation."
© 2022 by Dave Taylor. "Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.
Privacy Policy - Terms and Conditions - Accessibility Policy