Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8489975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:58:37+00:00 2026-06-10T21:58:37+00:00

I have a basic inotifywait script called watch.sh and a few files ending in

  • 0

I have a basic inotifywait script called watch.sh and a few files ending in .styl in the same directory. Here’s the script, that catches the changes, but doesn’t execute the code within the do/done

I init it like sh watch.sh and here’s the script

#!/bin/sh

while inotifywait -m -o ./log.txt -e modify ./*.styl; do
  stylus -c %f
done

I tried having echo "hi" within the exec portion but nothing executes

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T21:58:39+00:00Added an answer on June 10, 2026 at 9:58 pm

    The problem you are having is with the -m option for inotifywait. This causes the command to never exit. Since while checks the exit status of a command, the command must exit in order to continue execution of the loop.

    Here is the description of -m from the manpage:

    Instead of exiting  after  receiving  a  single  event,  execute
    indefinitely.   The default behaviour is to exit after the first
    event occurs.
    

    Removing the -m option should resolve your issues:

    while inotifywait -o ./log.txt -e modify ./*.styl; do
      stylus -c %f
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have basic issue that i don't understand, we use HEAT to consume directory
I have a basic PHP form (a few fields and 2 checkboxes, I want
I have a basic web service that returns the following object as JSON: public
I have basic stored procedure that performs a full text search against 3 columns
Heres my problem, I'm web developer and I have a web based script(PHP/CURL/HTML/JS) that
I have basic code that looks like this: while(inputfileStream.good()) { for(int i = 0;i<levels;i++)
I have basic function that prints network errors based on enum NetworkError. that looks
I have basic JavaScript code that needs to tell how many names out of
I have a data-intensive Python script that uses HTTP connections to download data. I
I have basic Spring MVC 3 setup for i18n where I can show labels

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.