All Questions
31 questions
0
votes
0
answers
391
views
Open GUI linux terminal in non-interactive mode
It would be helpful if I can open a terminal and run commands exactly as if they would be run by a non-interactive bash script, to test whether certain commands work in non-interactive mode without ...
-2
votes
1
answer
793
views
How to remove query parameters from file extensions? [duplicate]
How to remove query parameters from file extensions
i have downloaded 260 000 image files, which look like this:
filename.jpg?
filename2.jpg?
filename3.jpg?
how can i easily rename/remove the ...
0
votes
0
answers
995
views
Welcome message in the terminal
I'm trying to create a script that shows a welcome message when the root user enters the terminal.
My current problem is that the welcome message also gets shown if a normal user starts the terminal......
0
votes
0
answers
185
views
Arguments to change awk variables
Newbie at Bash Scripting.
List of Data:
Filename has date included "0310_Filename"
Hour AM/PM Game 1 Game2 Game 3
12:00:00 AM First Last First Last First Last
I am ...
0
votes
1
answer
1k
views
How to add a text file into a bash script then work with that text file
I need to read into my script 3 parameters, the first 2 are numbers and the third one is a .txt file.
For example:
example.sh 3 2 exam.txt
And with the third parameter exam.txt that already has some ...
1
vote
0
answers
96
views
Changing the Creation/Modification Dates of Nested Folders
I have 1,000,000 .mp4 files in a single folder (Mac) and was looking for some code that would move the files into dated folders based on their creation/modified dates (they are the same).
@pLumo came ...
-1
votes
1
answer
1k
views
I need to bruteforce a 4-digit-pin locked executable program in Linux terminal. Help? I am new to Linux
I have a program called program-5.exe that takes one 4-digit argument. If it is correct, I get access and complete the challenge but otherwise it just denies access. What I think I mainly need to know ...
1
vote
2
answers
17k
views
Programmaticaly open new terminal with Bash and run commands, keeping job-control
In an X session, I can follow these steps:
Open a terminal emulator (Xterm).
Bash reads .bashrc and becomes interactive. The command prompt
is waiting for commands.
Enter vim 'my|file*' '!another ...
0
votes
2
answers
1k
views
How to run a python cmd inside a bash cmd over ssh
When I run the following in my bash terminal, it works fine.
$ bash -c "python -c \"print 'helloworld'\"" ---> helloworld
However when I try to do this over ssh, it give me nothing, can someone help ...
0
votes
2
answers
135
views
Edit script to email output?
I'm basically trying to put two scripts I found online together. The first, in two parts, checks if a directory exists, if not creates it then goes on to take a picture through the webcam if an ...
0
votes
0
answers
286
views
Indent output even for partial lines
I'm trying to indent the output of 'subcommands' in a script, like this:
Turning off image...
Unmounting...done.
Detaching loop device...done
where the indented items are individual steps ...
1
vote
1
answer
946
views
getopts in function that is called more than once in a script, getopts doesn't detect any opts after 1st function call [duplicate]
I have read the getopts man page and am still not sure about this use case.
getopts is not detecting any available options the second time a function is called in the same script.
As you can see ...
2
votes
2
answers
3k
views
Strip the output of the ping command?
I would like to as if it is possible to strip the result of the 'ping' command form the last three lines which are always:
--- domain.com ping statistics ---
3 packets transmitted, 3 packets received,...
1
vote
0
answers
107
views
How to capture all std outputs [duplicate]
Suppose I have a program called mktemp which creates a random tmp directory in /tmp and also produces a string output of the directory address
Input[0]: mktemp
Output[0]: /tmp/tmp.MkrKAscwwk
How can ...
-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"$...