I am trying to combine multiple commands into a single output.
#!/bin/bash
x=$(date +%Y)
x=$($x date +m%)
echo "$x"
This returns
./test.sh: line 4: 2011: command not found
x=$(echo $(date +%Y) $(date +%m))
(Note that you've transposed the characters %
and m
in the month format.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With