[Bio-Linux] assigning bash variables

Tim Booth tbooth at ceh.ac.uk
Mon Feb 16 10:24:11 EST 2015


Hi Giulia,

Someone has switched your login shell to TCSH (or maybe CSH).  I've
confirmed that when I run those commands under TCSH I get the same
errors as you.

You can set your shell preference back by using the 'chsh' command.
You'll be prompted for the shell to use and you can either go
for /bin/zsh or /bin/bash.  ZSH is the Bio-Linux default as I find it a
more friendly interactive shell when using tab-completion etc. but BASH
is the more usual Linux shell and the default for Ubuntu.  Both are
supported on BL and both will accept variable assignments the way you
are trying (and as Bela noted, both use "export" to turn shell variables
into environment variables).  Log out then in again to get the new
shell.

If for some reason you don't want to run "chsh" on the account just run
"exec zsh" and you'll be in ZSH until you close the terminal.

Cheers,

TIM

On Mon, 2015-02-16 at 14:36 +0000, Bela Tiwari wrote:
> Hello, 
> 
> 
> 
> >I’m using Biolinux 8 on a university PC (I login as user and not
> admin) and I’m having problem with 
> >a very basic task – assigning variables in the shell!
> 
> 
> If you're trying to set environmental variables, you'll need to use
> export before the rest of the statement. 
> 
> e.g.
> 
> 
> export MYVAR=1 
> 
> 
> Setting environmental variables is covered on page 29 of the Bio-Linux
> tutorial:
> 
> 
> 
> http://nebc.nerc.ac.uk/downloads/courses/Bio-Linux/bl8_latest.pdf
> 
> 
> 
> I hope that's the information you were looking for. 
> 
> 
> 
> Best wishes, 
> 
> 
> 
> Bela
> 
> 
> 
> Den Mandag, 16. februar 2015 12.38 skrev Giulia Zancolli
> <g.zancolli at bangor.ac.uk>:
> 
> 
> 
> Hello,
> I’m using Biolinux 8 on a university PC (I login as user and not
> admin) and I’m having problem with a very basic task – assigning
> variables in the shell!
>  
> I type something very simple like 
>  
> a=1 
>  
> and I get the error: command “a=” not found
> 
> or the following (which was working perfectly in Linux on my laptop)
>  
> LIST="$(ls | grep "fastq$")"
>  
> And I get the error “Illegal variable name”
>  
> What might be wrong?
>  
> Any clue is very appreciated!
>  
> Giulia
>  
> Dr Giulia Zancolli
> Molecular Ecology and Fisheries Genetics Lab
> School of Biological Sciences    
> Bangor University
> Environment Centre Wales
> Bangor LL57 2UW                 
> UK 
>  
>  
> Rhif Elusen Gofrestredig 1141565 - Registered Charity No. 1141565
> Gall y neges e-bost hon, ac unrhyw atodiadau a anfonwyd gyda hi,
> gynnwys deunydd cyfrinachol ac wedi eu bwriadu i'w defnyddio'n unig
> gan y sawl y cawsant eu cyfeirio ato (atynt). Os ydych wedi derbyn y
> neges e-bost hon trwy gamgymeriad, rhowch wybod i'r anfonwr ar unwaith
> a dilewch y neges. Os na fwriadwyd anfon y neges atoch chi, rhaid i
> chi beidio a defnyddio, cadw neu ddatgelu unrhyw wybodaeth a gynhwysir
> ynddi. Mae unrhyw farn neu safbwynt yn eiddo i'r sawl a'i hanfonodd yn
> unig ac nid yw o anghenraid yn cynrychioli barn Prifysgol Bangor. Nid
> yw Prifysgol Bangor yn gwarantu bod y neges e-bost hon neu unrhyw
> atodiadau yn rhydd rhag firysau neu 100% yn ddiogel. Oni bai fod hyn
> wedi ei ddatgan yn uniongyrchol yn nhestun yr e-bost, nid bwriad y
> neges e-bost hon yw ffurfio contract rhwymol - mae rhestr o lofnodwyr
> awdurdodedig ar gael o Swyddfa Cyllid Prifysgol Bangor.
> This email and any attachments may contain confidential material and
> is solely for the use of the intended recipient(s). If you have
> received this email in error, please notify the sender immediately and
> delete this email. If you are not the intended recipient(s), you must
> not use, retain or disclose any information contained in this email.
> Any views or opinions are solely those of the sender and do not
> necessarily represent those of Bangor University. Bangor University
> does not guarantee that this email or any attachments are free from
> viruses or 100% secure. Unless expressly stated in the body of the
> text of the email, this email is not intended to form a binding
> contract - a list of authorised signatories is available from the
> Bangor University Finance Office.
> 
> _______________________________________________
> Bio-Linux mailing list
> Bio-Linux at nebclists.nerc.ac.uk
> http://nebclists.nerc.ac.uk/mailman/listinfo/bio-linux
> 
> 
> 

-- 
Tim Booth <tbooth at ceh.ac.uk>
NERC Environmental Bioinformatics Centre 

Centre for Ecology and Hydrology
Maclean Bldg, Benson Lane
Crowmarsh Gifford
Wallingford, England
OX10 8BB 

http://environmentalomics.org/bio-linux
+44 1491 69 2297




More information about the Bio-linux-list mailing list