Monday, April 29, 2024
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 812  / 2 Years ago, wed, august 3, 2022, 12:34:47

I have 2 Asus Zenbook laptops running Ubuntu 20.04.3LTS (my current laptop and I kept my old laptop as an emergency backup system as I can't be without a laptop). I very rarely use the old one, but I run sudo ap-get update and sudo apt-get upgrade every 3-4 weeks.


When I last opened it a couple of days ago, I got an error when I opened the terminal:


bash: /home/will/.bashrc: line 100: unexpected EOF while looking for 
matching `)'
bash: /home/will/.bashrc: line 121: syntax error: unexpected end of file

... although it seems to work fine for everything I've tried to do in the terminal.


As is so often the case, there's nothing obvious in the lines mentioned in the error that is the cause - I've had a quick look through and can't find anything I've changed anywhere else in the file that might cause it. Whilst I could probably hunt it down eventually, it's probably easier to replace the file.


My question is - as I have a second similar laptop running an identical version of Ubuntu, is there any reason not just to copy the functioning .bashrc from the newer laptop to replace the damaged one on my old laptop? I could presumably instead replace with the original version from a live USB (there are some posts on this site suggesting indirectly that that is possible), but it occurred to me that some of the aliases I created (and therefore in the .bashrc on my newer laptop) would be useful to have on the old laptop.


If this is possible, please also say if you're aware of any circumstances when it would not be a good idea. Presumably not sensible between different releases of Ubuntu? This isn't relevant to my situation, but (out of interest) I assume it wouldn't matter if the hardware is very different (eg laptop vs desktop)?


Edit: in response to the comments: it is a self contained file. The only modifications I have (knowingly) made are to add some aliases (to sync data on my encrypted partition with an external keypad encrypted drive). I’ve obviously had a look at the aliases to check I didn’t make a simple mistake but can’t find anything obvious.


More From » command-line

 Answers
5

I don't think there is any reason not to copy and replace the old .bashrc file with the new unless you have a large amount of custom configurations in the file.


The new .bashrc file will be a good, perfectly functioning replacement, assuming there are no user specific custom configurations in the new file.


Just to be safe, it's always best to make a backup of the old file.


[#1005] Thursday, August 4, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
enefiama

Total Points: 43
Total Questions: 125
Total Answers: 102

Location: Gabon
Member since Sat, Jul 25, 2020
4 Years ago
enefiama questions
Sat, Jun 19, 21, 01:27, 3 Years ago
Mon, May 23, 22, 09:15, 2 Years ago
Mon, Aug 8, 22, 03:41, 2 Years ago
Sat, Jul 2, 22, 04:59, 2 Years ago
;