[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suddenly, periods / dots in variable values are converted to space
From: |
Greg Wooledge |
Subject: |
Re: Suddenly, periods / dots in variable values are converted to space |
Date: |
Mon, 23 Jan 2023 17:08:49 -0500 |
On Mon, Jan 23, 2023 at 02:17:30PM -0700, Chandler wrote:
> export File1="/dev/sda/file1.txt"
>
> Previously, I could just use a command like `less $File1` and it would bring
> up the file. Now, the dot in the filename is converted to a space and less
> tries to open 2 separate files:
>
> $ less $File1
> /dev/sda/file1: No such file or directory
> txt: No such file or directory
1) You forgot to quote.
2) You have somehow managed to set IFS to a value which contains .
To fix this:
1) Use quotes when they are needed. less "$File1" will suppress all
IFS-based splitting.
2) IFS=$' \t\n' or unset IFS
- Suddenly, periods / dots in variable values are converted to space, Chandler, 2023/01/23
- Re: Suddenly, periods / dots in variable values are converted to space,
Greg Wooledge <=
- Re: [EXT]Re: Suddenly, periods / dots in variable values are converted to space, Chandler, 2023/01/23
- Re: [EXT]Re: Suddenly, periods / dots in variable values are converted to space, Greg Wooledge, 2023/01/23
- Re: [EXT]Re: Suddenly, periods / dots in variable values are converted to space, Chandler, 2023/01/23
- Re: [EXT]Re: Suddenly, periods / dots in variable values are converted to space, Kerin Millar, 2023/01/24
- Re: [EXT]Re: Suddenly, periods / dots in variable values are converted to space, Chandler, 2023/01/24
- Re: [EXT]Re: Suddenly, periods / dots in variable values are converted to space, Kerin Millar, 2023/01/25
- Re: [EXT]Re: Suddenly, periods / dots in variable values are converted to space, David, 2023/01/25
- Re: [EXT]Re: Suddenly, periods / dots in variable values are converted to space, Chandler, 2023/01/25
Re: [EXT]Re: Suddenly, periods / dots in variable values are converted to space, Chandler Sobel-Sorenson, 2023/01/23
Re: Suddenly, periods / dots in variable values are converted to space, Lawrence Velázquez, 2023/01/24