Skip to main content
deleted 2 characters in body
Source Link
Gilles 'SO- stop being evil'
  • 866.5k
  • 205
  • 1.8k
  • 2.3k

I came up with this example and as others have said in the comments it's the read line </dev/tty that's causing it to wait for user input.

#!/bin/bash find db -type f -name '*.jpg' -exec sh -c ' file="$0"·file="$0" echo "hi"·"hi" echo "$file" read line </dev/tty ' {} \; 

My script's output

hi db/db1440/gothamgardenxmas21440.jpg <---- I hit enter here hi db/db1440/unveiling11440.jpg <---- I hit enter here hi db/db1440/astronomer21440.jpg <---- I hit enter here ... 

I came up with this example and as others have said in the comments it's the read line </dev/tty that's causing it to wait for user input.

#!/bin/bash find db -type f -name '*.jpg' -exec sh -c ' file="$0"· echo "hi"· echo "$file" read line </dev/tty ' {} \; 

My script's output

hi db/db1440/gothamgardenxmas21440.jpg <---- I hit enter here hi db/db1440/unveiling11440.jpg <---- I hit enter here hi db/db1440/astronomer21440.jpg <---- I hit enter here ... 

I came up with this example and as others have said in the comments it's the read line </dev/tty that's causing it to wait for user input.

#!/bin/bash find db -type f -name '*.jpg' -exec sh -c ' file="$0" echo "hi" echo "$file" read line </dev/tty ' {} \; 

My script's output

hi db/db1440/gothamgardenxmas21440.jpg <---- I hit enter here hi db/db1440/unveiling11440.jpg <---- I hit enter here hi db/db1440/astronomer21440.jpg <---- I hit enter here ... 
Post Undeleted by slm
added more details
Source Link
slm
  • 380.2k
  • 127
  • 793
  • 897

You need to separate your commandsI came up with this example and as others have said in the comments it's the shread -cline '...'</dev/tty block with semicolons like so:that's causing it to wait for user input.

read -e DIRECTORY#!/bin/bash find $DIRECTORYdb -type f -name '*.mov'jpg' -exec sh -c '  file="$0"· echo file="$0";"hi"· echo "$file" read echoline "Processing</dev/tty ' $file{} ..\; 

My script's output

hi db/db1440/gothamgardenxmas21440.";jpg modmovie  <-notrack--- "TimecodeI Track"hit $fileenter here hi db/db1440/unveiling11440.jpg  <-save-in-place; - I readhit lineenter <here hi db/devdb1440/tty;astronomer21440.jpg ' {} \; <---- I hit enter here ... 

You can read more about the semicolon (command separator) here in the Advanced Bash FAQ.

You need to separate your commands in the sh -c '...' block with semicolons like so:

read -e DIRECTORY find $DIRECTORY -type f -name '*.mov' -exec sh -c '   file="$0"; echo "Processing $file ..."; modmovie -notrack "Timecode Track" $file -save-in-place;  read line </dev/tty; ' {} \; 

You can read more about the semicolon (command separator) here in the Advanced Bash FAQ.

I came up with this example and as others have said in the comments it's the read line </dev/tty that's causing it to wait for user input.

#!/bin/bash find db -type f -name '*.jpg' -exec sh -c ' file="$0"· echo "hi"· echo "$file" read line </dev/tty ' {} \; 

My script's output

hi db/db1440/gothamgardenxmas21440.jpg   <---- I hit enter here hi db/db1440/unveiling11440.jpg  <---- I hit enter here hi db/db1440/astronomer21440.jpg  <---- I hit enter here ... 
Post Deleted by slm
added more details
Source Link
slm
  • 380.2k
  • 127
  • 793
  • 897

You need to separate your commands in the sh -c '...' block with semicolons like so:

read -e DIRECTORY find $DIRECTORY -type f -name '*.mov' -exec sh -c ' file="$0"; echo "Processing $file ..."; modmovie -notrack "Timecode Track" $file -save-in-place; read line </dev/tty; ' {} \; 

You can read more about the semicolon (command separator) here in the Advanced Bash FAQ.

You need to separate your commands in the sh -c '...' block with semicolons like so:

read -e DIRECTORY find $DIRECTORY -type f -name '*.mov' -exec sh -c ' file="$0"; echo "Processing $file ..."; modmovie -notrack "Timecode Track" $file -save-in-place; read line </dev/tty; ' {} \; 

You need to separate your commands in the sh -c '...' block with semicolons like so:

read -e DIRECTORY find $DIRECTORY -type f -name '*.mov' -exec sh -c ' file="$0"; echo "Processing $file ..."; modmovie -notrack "Timecode Track" $file -save-in-place; read line </dev/tty; ' {} \; 

You can read more about the semicolon (command separator) here in the Advanced Bash FAQ.

Source Link
slm
  • 380.2k
  • 127
  • 793
  • 897
Loading