All Questions
44 questions
0
votes
0
answers
71
views
Why is the startup script specified in the ENV variable executed twice in sh?
I want to put some actions when a non-login terminal is opened, but for some reason, it is executed twice. On the system default shell is sh, symlink to bash.
I set the value in environment variable ...
1
vote
2
answers
5k
views
How to run the command "sudo sh /path/to/script.sh" by double clicking?
I have a question from this thread How to run a bash script by double clicking by entering the path in sudoers?. Since it was explained to me that it is unsafe to grant sudo privileges to the script....
0
votes
0
answers
51
views
How to run a process in the background using a bash script? [duplicate]
When I run the command in the terminal: sudo badvpn-tun2socks --tundev tun0 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:8080 I get a terminal with packet data ...
-3
votes
1
answer
243
views
What happens if you put /dev/urandom into a shell script and run it?
I want to know what happens when you run the contents of /dev/urandom as a shell script. I know when you cat it into a terminal it will set off a bunch of random things in the terminal environment. ...
0
votes
0
answers
73
views
BASH: Is there a way to READ the current foreground and background color in use? Not CHANGE them... just see what the user is using NOW? [duplicate]
Some background for any who find this later
This is a question about colors being applied in the shell. NOT about how to CHANGE said colors (there's a bajillion answers for that). But how to READ them....
1
vote
1
answer
156
views
How is it possible that this doesn't work even if you use quotes?
I know that to deal with spaces in file names you should wrap the entire file name between quotes but this is not working for this script, indeed what is happening is the exact opposite, it only works ...
0
votes
1
answer
795
views
script to find the Position of Substring in Given String bin/bash
we have to write a shell program that will tell the position (index) of the substring in a given string.
sample input:-
Code Quotient - Get Better at Programming
at
sample output :-
28
i have ...
0
votes
0
answers
16
views
How to create a sub-window in a terminal? [duplicate]
I would like to print to a clean terminal, but not issue a clear or reset command such that the user will not lose data. After the printing is done, I would like to put the user in their old (root) ...
0
votes
2
answers
4k
views
Disable underlining Kali Linux terminal / command line
Some text is being underlined in terminal, which is very annoying as one doesn't know if there is underscore or not:
How can I disable underlining? Tried to search google/stack, but no luck. Thanks.
1
vote
1
answer
1k
views
How to strip off certain hexadecimal characters in Bash?
I have gathered a wordlist for person to follow on twitter. However, there is a problem.
When i cat and do xxd a extra hidden characters are found. i.e 1b5b 6d1b 5b4b . I need to strip those character....
0
votes
1
answer
2k
views
Shell script to scroll down the whole text in terminal without modifying it
I'm trying to use a /bin/sh script to scroll down a couple of lines of text in terminal.
A solution using smcup, rmcup is not acceptable in this case.
A couple of other options I tried all failed (...
0
votes
0
answers
212
views
Run a script in a new terminal window, but the same terminal emulator as the current window
I want to run a script in a new terminal window. I found several solutions such as this. However, they all provide terminal specific solutions. So konsole ./myscript.sh works if I'm using konsole, but ...
0
votes
1
answer
9k
views
How to count number of files in a directory that are over a certain file size [duplicate]
Is there a way to count how many files in a specific directory are over some file size? Say, 100 MB?
1
vote
1
answer
2k
views
I have a long running script but want to be able to scroll through the stdout output as it executes
I have a script that runs for a long time. It has plenty of output to stdout that I would like to be able to read over in real time but also scroll up and down. Whenever a new line of output is ...
-1
votes
2
answers
1k
views
Replace a variable with stdin?
I want to loop over some values and I know I can simply use a for loop but is there any other way that I can replace a variable value in a command at the end of the command?
Somewhat like
echo 11"$...