bash scripting simple question
Presently i'm using this script like this :
./myscipt.sh file1.txt. But for personnal reason I would like to use it this way : cat file1.txt | myscript.sh and i can't find out how... thanks for your help #!/bin/sh : # Start sending data ( copies=1 files="$1" i=1 while [ $i -le $copies ] ; do for file in $files ; do # insert init strings here printf "\033E" # Reset printer printf "\033&k2S" # Compress printing printf "\033&k2G" # crlf printf "\033(s3B" # bold cat ${file} printf "\014" # Send form feed done i=`expr $i + 1` done ) | lp -s -dW1PP |
you'd use a while read loop...
Code:
#!/bin/sh |
All times are GMT -5. The time now is 12:14 PM. |