Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Can anyone explain me why
VBB:~ me$ test="zut"; echo $test; echo $test > test2; echo "echo test " $test2
output is :
zut echo test VBB:~ me$
and not
zut echo test zut VBB:~ me$
Because echo $test > test2 writes the output to a file named test2.
echo $test > test2
this set of commands is does what you would expect:
test="zut"; echo $test; test2=$test; echo "echo test " $test2
Add a comment
Addition to first answer you can assign the value in the file a variable.
echo "$var" ; var= more test2
So you can get string after you wrote to file test2
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.