Tagged Questions
2
votes
1answer
100 views
How to put “glue” CWD (etc.) to part of the screen instead of putting into PS1?
I suspect there’s some terminology for this question that I’m not aware of. It’s hard to check if a question has already been answered if one doesn’t know the proper vocabulary. So, sorry if this is ...
1
vote
1answer
201 views
When a command is over half the terminal size it breaks
Whenever I type in a bash command longer than about half the width of the shell window I'm in, the command breaks like it would if I filled the whole screen
3rd command in image - typed a few xs ...
3
votes
2answers
857 views
executing if-statement from command prompt
In bash I can do the following:
if [ -f /tmp/test.txt ]; then echo "true"; fi
However, if I add sudo in front, it doesn't work anymore:
sudo if [ -f /tmp/test.txt ]; then echo "true"; fi
-bash: ...
2
votes
2answers
209 views
Shell Prompt Customization?
I have used oh_my_zsh (and tinkered with bash_it) on multiple systems and have generally been happy with it, though I hate it's auto-correction feature and generally turn it off.
My usual shell is ...
2
votes
1answer
213 views
There is no bash indicator prompt after a forked process terminates
I am reading the book Advanced Programming in the Unix Environment.
There is a test program to test the fork function. It works well in my Ubuntu. But what I confused is that why there is no command ...
4
votes
5answers
261 views
Conflict between my prompt definition and cat in zsh
I have a file on a remote filesystem that I know has a short text string in it (a sequence of numbers in a single line). If I open the file on a text editor like nano or Emacs I can see the string. ...
3
votes
4answers
452 views
Which stream does Bash write its prompt to?
I am trying to redirect all output from bash (prompt, user input, results) to a file
Example:
/bin/bash > file.txt 2>&1
I thought that would work, but I'm not getting the prompt. Can ...
3
votes
1answer
188 views
ssh behavior for root and non-root user
When I ssh as root to a remote machine, the command output looks like this:
root@Machine:/current/path#:
However, if it's a non-root user, all I see is:
$
How can I get the same behavior as for ...
3
votes
3answers
564 views
Is there a way to make the prompt definition multiline?
This is my current prompt definition:
PS1=$'%F{063}%1~%f %(1v.%F{099}%1v %f.)%F{063}%%%f '
RPROMPT='$VIMODE %m'
and I'm working on integrating this. Basically I'm starting to find it very ...