I want to do some simple calculations with variables in an script.sh
, in the same directory there is a folder called New Folder2
. So, I want to enter into the folder and save a text file.
The script is the following:
#!/bin/bash
foldername='New Folder'
number=1
number=$number+1
cd $foldername$number
echo '$number' > number.txt
But then I only get the file number.txt
in the same directory ./
with 1+1
not the actual sum. What should I do?