herestring Questions
4
Solved
What does the triple-less-than-sign bash operator, <<<, mean, as inside the following code block?
LINE="7.6.5.4"
IFS=. read -a ARRAY <<< "$LINE"
echo "$IF...
Indonesia asked 31/10, 2011 at 5:32
3
Solved
Placing the following within a script will fail:
$MyString = @'
hello
@'
'@
bye
'@
write-host $MyString
The error returned is as follows:
At C:\scripts\test.ps1:6 char:1
+ '@
+ ~~
The string i...
Scincoid asked 19/10, 2016 at 9:47
2
Solved
I'm attempting to update the hosts file on a Windows server and trying to do it using a heredoc in powershell.
I can't figure out why my result has extra spaces between every character in each host...
Boart asked 16/8, 2019 at 22:32
1
Solved
Quoting Bash Reference Manual and man bash (version 4.3):
[n]<<< word
The word undergoes brace expansion, tilde expansion, parameter and
variable expansion, command substitution, ar...
Capitoline asked 11/12, 2017 at 0:8
2
Solved
Assume a file file with multiple lines.
$ cat file
foo
bar
baz
Assume further that I wish to loop through each line with a while-loop.
$ while IFS= read -r line; do
$ echo $line
$ # do stuff
$ ...
Padriac asked 26/6, 2017 at 20:1
3
Solved
It seems that here string is adding line break. Is there a convenient way of removing it?
$ string='test'
$ echo -n $string | md5sum
098f6bcd4621d373cade4e832627b4f6 -
$ echo $string | md5sum
d8e8...
Insurer asked 9/6, 2016 at 14:24
3
Solved
I was using:
cat <<<"${MSG}" > outfile
to begin with writing a message to outfile, then further processing goes on,
which appends to that outfile from my awk script.
But now logic h...
Eparchy asked 8/7, 2014 at 14:5
1
© 2022 - 2024 — McMap. All rights reserved.