Script:
#!/bin/bash
mydir="/bamboo/artifacts"
cd "$mydir"
job="-JOB1"
for dir in */
do
bambooplan=`echo $dir | sed 's/\/$//g'`$job
echo $bambooplan
done
Output:
LERST-TSTREDAPIDB2WIN4-JOB1
LERST-TSTREDAPIDB2WIN5-JOB1
CA-TSTALLSQLWIN3-JOB1
CE-CSW-JOB1
CE-SNAP-JOB1
I want to pass this to a file. I tried the commands below and it gives permission denied error. Could someone help me figure what I miss here?
echo $bambooplan > result.txt
$bambooplan > result.txt