Jump to content

Puzzling problems !!


abarbarian

Recommended Posts

abarbarian

My pc running Arch has been working perfectly normally for quite some time now and has no problems that I know of.

 

I have spent the last three days messing around with external drives and Luckybackup, grsync and rsync. Found all sorts of weird and wonderful glitches and problems and had quite a bit of fun sorting and learning about the inner workings of linux.

 

I use a Star Tech external usb3 dock that allows me to slot in two sata drives. My Arch set up finds these drives and automounts them to /run/media/me/whatever the drive is called.

 

The external drives have all been wiped and formated to GPT with one ext4 partition.

 

Puzzle one.

 

Yesterday I made a backup of my /home to an external drive using rsync. Everything seemed to be ok.The backup folder contents were as expected. My xterm terminal worked as normal. I shut down the external drive after unmounting it. I left the pc running as I crunch for the World Community Grid.

 Opened up a terminal this morning and got this,

 

voHwWGm.png

 

This appeared at the beginning of the terminal.

 

I wanted to do,

source ~/.bashrc

but got this and keep on getting the same message every time I try to use it.

>source ~/.bashrc
-bash: This: command not found

I tried out several other commands and they all seem to work ok as you can see from the screenshot. All new terminal show that same "-bash: This: command not found" and every time I try the "source ~/.bashrc" command I get the warning.

"source ~/.bashrc" worked perfectly last night as I made a new alias and tried it out and all worked as normal.

 

What is going on ?

🙄

 

 

Edited by abarbarian
Link to comment
Share on other sites

securitybreach

I think there is simply an error in your ~/.bashrc. Can you post your ~/.bashrc here?

 

You have the word "This" uncommented or added.

Link to comment
Share on other sites

abarbarian
11 hours ago, securitybreach said:

I think there is simply an error in your ~/.bashrc. Can you post your ~/.bashrc here?

 

You have the word "This" uncommented or added.

 

Apart from the new alias for rsync my .bashrc has not changed, unless I have inadvertantly hit a key and printed a stray character somewhere, but it all looks ok to me.

Quote

 

#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

export EDITOR='nano'
export PATH="/usr/lib/ccache/bin/:$PATH"
export PATH=$PATH:$HOME/bin #this is the place for all my own scripts.
export HISTCONTROL=$HISTCONTROL:ignorespace:ignoredups
#PS1='[\h@\t \W]\$ '
export PS1="\[\033[38;5;75m\]\t\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;21m\]-->\[$(tput sgr0)\]\[\033[38;5;75m\]\d\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;21m\]-->\[$(tput sgr0)\]\[\033[38;5;2m\]\W\[$(tput sgr0)\]\n\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;21m\]-->\[$(tput sgr0)\]"


# remember the last 1000 commands in history
HISTSIZE=1000
# Limit the size of the ~/.bash_history file
HISTFILESIZE=2000

# append to the history file, don't overwrite it
shopt -s histappend

# Avoid duplicate entries
export HISTCONTROL=ignoredups:erasedups

#ALIAS
######

###after creating an alias you need to

###reboot or $ source ~/.bashrc

alias sudo="sudo " #Create an alias for sudo with a space at the end then all other aliases will work with sudo without the need for a password.
#alias   w7="sudo mount /dev/nvme0n1p3 /mnt"
#alias   w7u="sudo umount /dev/nvme0n1p3"
#alias  ls="ls --color=auto"
alias    x="startx"

alias  pacu="pacaur -Syu"
alias  paci="pacaur -S"
alias  pacr="pacaur -Rns"
alias  pacq="pacaur -Q"
alias pacor="pacaur -Rns $(pacman -Qtdq)" #recursively removing orphans and their configuration files

alias  rbs="firejail --private --dns=8.8.8.8 --dns=8.8.4.4 firefox -no-remote"
alias  transmission-gtk="firejail transmission-gtk"

alias   gf="grim-fandango"
alias   ha="hangman"


alias    ss="scrot -s"
alias    handbrake="ghb"
This rsync will backup my /home and provide a date stamp in the folder name.
#alias    homeback="rsync -vaHAXShix --delete --exclude=slots --exclude=tempfile --exclude=.local/share/Trash --exclude=projects --exclude=.local/share/gvfs-metadata --exclude=/home/*/.gvfs /home/bloodaxe/  /run/media/bloodaxe/HISTORY/HOME$(date +\\%d-\\%m-\\%Y)"
alias    homeback="rsync -vaHAXShix --delete --exclude=slots --exclude=tempfile --exclude=.local/share/Trash --exclude=projects --exclude=.local/share/gvfs-metadata --exclude=/home/*/.gvfs /home/bloodaxe/  /run/media/bloodaxe/HISTORY/HOME$(date +\\%26-\\%05-\\%2020)"

#alias   kss="ksnip" uninstalled
#alias   boa="flatpak run com.realm667.WolfenDoom_Blade_of_Agony"
#alias  santas="echo MERRY CHRISTMAS AND A HAPPY NEW YEAR TO EVERYONE | boxes -d santas -p a3l4"

 

 

😎

Link to comment
Share on other sites

securitybreach

Note the bottom:

 

Quote

alias    ss="scrot -s"
alias    handbrake="ghb"
This rsync will backup my /home and provide a date stamp in the folder name.
#alias    homeback="rsync -vaHAXShix --delete --exclude=slots --exclude=tempfile --exclude=.local/share/Trash --exclude=projects --exclude=.local/share/gvfs-metadata --exclude=/home/*/.gvfs /home/bloodaxe/  /run/media/bloodaxe/HISTORY/HOME$(date +\\%d-\\%m-\\%Y)"
alias    homeback="rsync -vaHAXShix --delete --exclude=slots --exclude=tempfile --exclude=.local/share/Trash --exclude=projects --exclude=.local/share/gvfs-metadata --exclude=/home/*/.gvfs /home/bloodaxe/  /run/media/bloodaxe/HISTORY/HOME$(date +\\%26-\\%05-\\%2020)"

#alias   kss="ksnip" uninstalled
#alias   boa="flatpak run com.realm667.WolfenDoom_Blade_of_Agony"
#alias  santas="echo MERRY CHRISTMAS AND A HAPPY NEW YEAR TO EVERYONE | boxes -d santas -p a3l4"

 

 

That part is not commented out. It should say:

Quote

# This rsync will backup my /home and provide a date stamp in the folder name.

 

  • Like 1
Link to comment
Share on other sites

abarbarian
7 hours ago, securitybreach said:

That part is not commented out. It should say:

Quote

# This rsync will backup my /home and provide a date stamp in the folder name.

 

 

Bravo :clap2: I spent over an hour searching for a solution and kept getting all sorts of complicated results but nothing relevant. I would never have spotted the missing #.

Link to comment
Share on other sites

abarbarian

Ok another puzzle.

 

This one is not critical I just would like to know why.

 

I made a command,

 

rsync -vaHAXShix --delete --exclude=slots --exclude=tempfile --exclude=.local/share/Trash --exclude=projects --exclude=.local/share/gvfs-metadata --exclude=/home/*/.gvfs --exclude=.local/share/gvfs-metadata /home/bloodaxe/  /run/media/bloodaxe/HISTORY/bloodaxe$(date +\\%d-\\%m-\\%Y)

this gives me a folder called

 

bloodaxe\25-\05-\2020

however when I make a alias with the same command and use the alias I get a folder called,

bloodaxe25-05-2020

Should not my alias output the same folder name ? I thought alias's simply duplicated the given command wheras my example seems to alter the original command.

 

Answers on a pin head please. 😎

Link to comment
Share on other sites

securitybreach
37 minutes ago, abarbarian said:

 

Bravo :clap2: I spent over an hour searching for a solution and kept getting all sorts of complicated results but nothing relevant. I would never have spotted the missing #.

 

I only knew as I've done something similar in the past

Link to comment
Share on other sites

securitybreach
45 minutes ago, abarbarian said:

Should not my alias output the same folder name ? I thought alias's simply duplicated the given command wheras my example seems to alter the original command.

 

That is exactly what it does and the output depends on your command/switches.

Link to comment
Share on other sites

abarbarian
23 minutes ago, securitybreach said:

 

That is exactly what it does and the output depends on your command/switches.

I do not understand yer answer.

rsync -vaHAXShix --delete --exclude=slots --exclude=tempfile --exclude=.local/share/Trash --exclude=projects --exclude=.local/share/gvfs-metadata --exclude=/home/*/.gvfs --exclude=.local/share/gvfs-metadata /home/bloodaxe/  /run/media/bloodaxe/HISTORY/bloodaxe$(date +\\%d-\\%m-\\%Y)

alias homebackup="rsync -vaHAXShix --delete --exclude=slots --exclude=tempfile --exclude=.local/share/Trash --exclude=projects --exclude=.local/share/gvfs-metadata --exclude=/home/*/.gvfs --exclude=.local/share/gvfs-metadata /home/bloodaxe/  /run/media/bloodaxe/HISTORY/bloodaxe$(date +\\%d-\\%m-\\%Y)"

Why do the two commands give different output ? Surely they should give the same output ? 🤔

Link to comment
Share on other sites

Hedon James

a little above my paygrade AB, but is it possible the different commands are being run in different terminals/shells, with differing syntax treatments?

 

I saw above your aliases are in "bourne again shell" (BASH) profile, but I think you said you're running Xterm for CLI commands.  Would the different outputs be due to Xterm and Bash treating the command differently?  Just a theory.

Link to comment
Share on other sites

securitybreach
40 minutes ago, Hedon James said:

a little above my paygrade AB, but is it possible the different commands are being run in different terminals/shells, with differing syntax treatments?

 

I saw above your aliases are in "bourne again shell" (BASH) profile, but I think you said you're running Xterm for CLI commands.  Would the different outputs be due to Xterm and Bash treating the command differently?  Just a theory.

 

Xterm uses bash by default. Bash, Zsh(zshell), Fsh and others are simply various Unix shells. Xterm, gnome-terminal, konsole, etc. are terminal emulators.

 

Think of bash, zsh, fsh, etc as environments and xterm, konsole, etc as programs that lets you interact with that environment.

  • Like 1
Link to comment
Share on other sites

abarbarian
On 5/27/2020 at 12:14 PM, securitybreach said:

 

That is exactly what it does and the output depends on your command/switches.

 

I am guessing that your reply relates to this section of the Bash Reference Manual,(which would take a lifetime of study to understand never mind allow me to use it with any expertise)

 

https://tiswww.case.edu/php/chet/bash/bashref.html#Modifying-Shell-Behavior

 

I have made some changes to the way bash acts in .bashrc. So far though every alias I have made acts exactly as the original cli would. I can not see that any changes made in .bashrc that would alter the output of an alias.

So am still puzzled.

 

😎

Link to comment
Share on other sites

abarbarian
2 hours ago, Hedon James said:

 

You anticipated my question!  Thanks for the link.  Would it be safe to say that a terminal runs outside of X (or Wayland), while terminal emulators run on top of, or within, X?  Other than that distinction, I don't really see a difference.

 

I see Josh gave you a link but this may help even more, or not, lol.

 

Computer terminal

 

Quote

A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and displaying or printing data from, a computer or a computing system.[1] The teletype was an example of an early day hardcopy terminal,[2] and predated the use of a computer screen by decades.[3]

 

🤓

  • Agree 1
Link to comment
Share on other sites

securitybreach
1 hour ago, abarbarian said:

 

I am guessing that your reply relates to this section of the Bash Reference Manual,(which would take a lifetime of study to understand never mind allow me to use it with any expertise)

 

https://tiswww.case.edu/php/chet/bash/bashref.html#Modifying-Shell-Behavior

 

I have made some changes to the way bash acts in .bashrc. So far though every alias I have made acts exactly as the original cli would. I can not see that any changes made in .bashrc that would alter the output of an alias.

So am still puzzled.

 

😎

 

No, I simply meant it would depend on the switches that you used. That was before you posted the two commands. By switches, I meant the options that you used. Like

 

ls -la

 

-la is the switches for ls

Link to comment
Share on other sites

abarbarian
3 hours ago, securitybreach said:

 

No, I simply meant it would depend on the switches that you used. That was before you posted the two commands. By switches, I meant the options that you used. Like

 

ls -la

 

-la is the switches for ls

Ok I see what you meant.

 

However I still do not know why I have a different output. 🤔

Link to comment
Share on other sites

securitybreach
2 hours ago, abarbarian said:

Ok I see what you meant.

 

However I still do not know why I have a different output. 🤔

 

Yeah, me neither 😕

Link to comment
Share on other sites

securitybreach
10 hours ago, abarbarian said:

 

I'll ask over at the Arch forums. 😎

 

Ha, good luck with that. You better do due diligence and search first :hysterical:

  • Like 1
Link to comment
Share on other sites

securitybreach
2 hours ago, abarbarian said:

By gum the world must be ending as I not only got a reply over at the Arch forums, it was a very kind and useful reply.

 

https://bbs.archlinux.org/viewtopic.php?pid=1907592#p1907592

 

Well done them friendly helpful folk at the Arch Forums :th_1sm168massbounce::worthy::worthy::th_1sm168massbounce:

 

Well that was because they felt bad for you having to run Windowmaker. ;) :hysterical:

 

There were some good info in the comments :thumbsup:

  • Haha 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...