Mmh, what version are you using? We don't expand the $2 inside quotes, the
following similar code works fine for me in the notebook (not trying yours
as I don't have the aws cli installed):
user = 'root'
!ps aux | grep $user | awk '{print $2}'
On Mon, Jul 11, 2016 at 4:55 PM, Andy Davidson <
[email protected]> wrote:
>
>
> The following will run a shell script and store the results in a juypter
> variable ‘dataSet’
>
> *dataSets = !aws s3 ls
> s3://com.pws.twitter/json/StreamingKafkaGnipCollector/gnip/ |grep PRE | awk
> -F'PRE' '{print $2}'*
>
>
> If I try and define a variable that represents the URL the command will
> fail.
>
> *baseURL="s3://com.pws.twitter/json/StreamingKafkaGnipCollector/gnip/"*
> *!echo $baseURL*
> *dataSets = !aws s3 ls $baseURL | grep PRE | awk -F'PRE' '{print $2}’ *
>
> The problem is with my awk command. I think maybe the note book is trying
> to expand $2.
>
> Any idea how I can fix this?
>
> Thanks
>
> Andy
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/D3A97FFB.40D33%25Andy%40SantaCruzIntegration.com
> <https://groups.google.com/d/msgid/jupyter/D3A97FFB.40D33%25Andy%40SantaCruzIntegration.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
--
You received this message because you are subscribed to the Google Groups
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jupyter/CAHAreOoTgjR2X%2BZdJnOOsB9DsBR8ndbhvhCFNRRJxVcxSV-y5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.