[raspberry-vi] Re: scripts

  • From: Dan Miner <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "dminer84" for DMARC)
  • To: <raspberry-vi@xxxxxxxxxxxxx>
  • Date: Fri, 15 Jan 2021 12:40:45 -0700

It is not clear what you're asking about to me but if it is how to create a
script like a batch file on Windows...

UNIX supports many scripting languages so it starts with a "preamble" to
tell the system where or how to find the script interpreter.  So, for a bash
script, it looks something like this:

--- cut ---
#!/bin/bash

Echo my bash commands follow...
--- cut ---

The bit without the cut lines is a script .  Place it in a text file and
next you need to mark the file as executable.  This can be several ways but
the lowest common way is in a terminal:

chmod u+x path_to_file
Remember, if you run from a terminal that your PATH is a factor and the
"current directory" is rarely included for security reason, thus it is
common to require ./myScript to run something in the current directory.

        Dan

-----Original Message-----
From: raspberry-vi-bounce@xxxxxxxxxxxxx <raspberry-vi-bounce@xxxxxxxxxxxxx>
On Behalf Of Glenn K0LNY
Sent: Friday, January 15, 2021 11:34 AM
To: raspberry-vi@xxxxxxxxxxxxx
Subject: [raspberry-vi] scripts

Hi All,
I thought I'd try making scripts, if I am calling them rightly, for playing
various radio frequencies.
I thought if I put the below line into a text file, and naming it something
like weather, or CB channel 19, or whatever, and adjust the line below to
reflect the proper frequency and band, and put them into a folder on the
desktop of my raspberry PI image, and if I could just then enter on them to
get them to play, it would be like folders of wanted channels for listening.
I've done batch files in DOS and Windows, but nothing like that in Linux,
and I plan on writing them in windows, and putting them on a thumb drive,
and copying them into the rPI.
Thanks, and the below command is what I'll be modifying for different
frequencies.
rtl_fm -M fm -f 162.550M -s 22k | play -t raw -r 22k -es -b 16 -c 1 -V1 -

=========================================================== 
The raspberry-vi mailing list 
Archives: //www.freelists.org/archives/raspberry-vi
Administrative contact: <mike.ray@xxxxxxxxxxxxxx>
-----------------------------------------------------------
Raspberry Pi and the Raspberry Pi logo are trademarks of the Raspberry Pi
Foundation.

This list is not affiliated to the Raspberry Pi Foundation and the views and
attitudes expressed by the subscribers to this list do not reflect those of
the Foundation.

Mike Ray, list creator, January 2013


=========================================================== 
The raspberry-vi mailing list 
Archives: //www.freelists.org/archives/raspberry-vi
Administrative contact: <mike.ray@xxxxxxxxxxxxxx>
-----------------------------------------------------------
Raspberry Pi and the Raspberry Pi logo are trademarks of the Raspberry Pi 
Foundation.

This list is not affiliated to the Raspberry Pi Foundation and the views and 
attitudes expressed by the subscribers to this list do not reflect those of the 
Foundation.

Mike Ray, list creator, January 2013

Other related posts: