Pages of ShellScript | Category: Programming, wikiX, |
#!/bin/bash for i in $( find -name tags ); do rm $i -f echo rm $i done |
for filename in $(find -name "mp3.o") ¶Ç´Â ¸ðµç ÆÄÀÏÀ» °Ë»öÇϱâ À§ÇØ for filename in $(find / -name "mp3.o") do ls -l $filename done |
for filename in $(locate "mp3.o") do ls -l $filename done |
$ i=4;echo `expr $i + 1` 5 |
foo=$(($foo+1)) |
$ i=4;while [ $i != 10 ]; do echo $i; i=`expr $i + 1`; done 4 5 6 7 8 9 $ i=4 ; while [ $i -lt 10 ]; do echo $i; i=$(($i+1));done 4 5 6 7 8 9 $ i=4 ; while [ $i -le 10 ]; do echo $i; i=$(($i+1));done 4 5 6 7 8 9 10 |
ÇÏ´Â ÀÏÀº ƯÁ¤ ÆÐÅÏÀÌ ÆÄÀÏ À̸§¿¡ ÀÖ´Â ÆÄÀÏÀ» Á¤ÇØÁØ À̸§+ÀϷùøÈ£.JPG·Î ¹Ù²ãÁÜ.
¿¹ ./rename.sh DSCN ÇÑ°_9¿ù- ÇÏ¸é µð·ºÅ丮 ³»ÀÇ ¸ðµç *DSCN* ÆÄÀϵéÀÌ ÇÑ°_9¿ù-01.JPG ÇÑ°_9¿ù-02.JPG .... µîÀ¸·Î ¹Ù²ï´Ù.
#!/bin/bash #rename.sh #simple file name replace echo usage : rename.sh pattern target_name echo Ex. rename.sh JPG MY_Picture echo -- all file name with JPG renamed to MY_Picture01.JPG .... j=0 criteria=$1 replace=$2 for i in $( ls *$criteria* ); do src=$i tgt=$( printf %s%02d.JPG ${replace} ${j} ) (( j++ )) mv -v $src $tgt done |
#!/bin/bash exec < $1 while read line do echo $line done |
#! /bin/sh IFS=, for i in `find . -name "Root" -printf %p,`; do echo "item: $i" cat $i #echo "change mod item: $i" #chmod 755 $i done |
¾Æ¿¹ find¿¡¼ ¹Ù·Î ó¸®ÇÏ´Â °Íµµ ÁÁ´Ù.
find . -name "Root" -exec cat {} \; |
mplayer mmst://<url> -dumpstream -dumpfile bcast.asf |
#!/bin/bash # internet radio recording. mplayer mmst://<url> -dumpstream -dumpfile <path>bcast.asf & /usr/local/bin/broadcast_stop.sh $1 $! & |
#!/bin/bash # kill process after given time. sleep $1 kill $2 |
crontab
39 7 * * * /usr/local/bin/broadcast_stop.sh 1260 # internet radio |
bcast-`date +%Y%m%d`.asf |
Pages of ShellScript | Category: Programming, wikiX, |