title: Why is this bash script not changing path?
body: <p>I wrote a basic script which changes the directory to a specific path and shows the list of folders, but my script shows the list of files of the current folder where my script lies instead of which I specify in script.</p>
  
  <p>Here is my script:</p>
  
  <pre><code>#!/bin/bash
  v1="$(ls -l | awk '/^-/{ print $NF }' | rev | cut -d "_" -f2 | rev)"
  v2=/home/PS212-28695/logs/
  cd $v2 &amp;&amp; echo $v1
  </code></pre>
  
  <p>Does any one knows what I am doing wrong?</p>