[raspberry-vi] Re: editing scripts

  • From: "Glenn K0LNY" <glennervin@xxxxxxxxxxxx>
  • To: <raspberry-vi@xxxxxxxxxxxxx>
  • Date: Wed, 20 Jan 2021 14:14:40 -0600

Tim,
I just tried
tr -d < *.sh
and it errored with ambiguous *.sh
Apparently I cannot do this to everything in a folder?

----- Original Message ----- 
From: "Tim Chase" <raspberry-vi@xxxxxxxxxxxxxxxxx>
To: <raspberry-vi@xxxxxxxxxxxxx>
Sent: Wednesday, January 20, 2021 2:04 PM
Subject: [raspberry-vi] Re: editing scripts


I suspect that the script contents contain Windows line-endings
(carriage-return, line-feed) rather than Unix line-endings (just a
line-feed).  You can strip out the carriage-return characters (\015
octal or 0x0D hexadecimal) easily enough with

  tr -d '\015' < script.sh > new_script.sh

and make the new_script.sh executable with

  chmod +x new_script.sh

If new_script.sh now works for you, that was the issue and you can
move it back overtop the original:

  mv new_script.sh script.sh

-tim

On January 20, 2021, Glenn K0LNY wrote:

Hi All,
So I made my scripts in windows, and they don't run.
I ran it in the terminal, and the last line error reads:
:numeric argument required
I'm wondering if that is referring to that I left out the line at
the end: exit 0
Here's the file contents:
#!/bin/bash
rtl_fm -M am -f 027.185M -s 22k | play -t raw -r 22k -es -b 16 -c 1
-V1 -


This command works when I type it in.
I did chmod +x *.sh in the folders with the .SH files.
Thanks.

Glenn
===========================================================
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

=========================================================== 
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: