2

Trying to fix the problem with tail, i can't avoid error when give tail a var with white spaces.

#!/bin/bash
.
.
.
function load_data
{
path="/home/robert/folder with_spaces/my_file"
}
.
.
.
function read_from_file
{
load_data
readed_line="$(tail -n 1 $path)"
}

and get error

tail: cannot open ‘/home/robert/folder’ for reading: No such file or directory
tail: cannot open ‘with_spaces/my_file’ for reading: No such file or directory

try to add string by $var+=$var1 modificated var's with: "" '' ``

but still the same


bash -version
GNU bash, version 4.3.11(1)-release (i686-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
gniourf_gniourf
  • 44,650
  • 9
  • 93
  • 104

0 Answers0