Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [shell-script]

A shell script is a script written for the shell, or command line interpreter, of an operating system.

1
vote
0answers
13 views

How can I read a password once, then pass it to the cryptsetup command repeatedly?

When i execute the cryptsetup command, it responds with a command line output - "Enter any existing passphrase:". I want to read this from console into my script and pass the passphrase from the ...
0
votes
0answers
18 views

Mac Application/File Opening Statistics

I would like to write to a file the time when I launch or quit any application on my Mac (10.14). Or even better, I hope I could write to a file the time when I open or close any file. Even better, I ...
0
votes
2answers
68 views

Customize csh prompt based on uid/superuser status

I'm trying to set up a condition where my csh prompt is customized to change username color and prompt character if I take on root privileges via "su". What's the most sensible way of doing this? ...
0
votes
1answer
24 views

Shell Scripting Interactive Functions

Newbie to Shell scripting... I'm looking to have an interactive setup script. It will ask questions and require the user to make a selection before continuing to the next step. The problem I'm ...
0
votes
0answers
34 views

Add an email alias with unattended GPG key generation

I am generating GPG keys with unattended key generation as described at https://www.gnupg.org/documentation/manuals/gnupg/Unattended-GPG-key-generation.html : gpg --batch --generate-key "genkeyconf" ...
0
votes
1answer
58 views

Downloading Youtube videos in a text file…?

If you are familiar to Linux, see the following script... I have a text file with a (list.txt) of Youtube URLs separated by new line... and I use cat list.txt | youtube-dl -f best to download all ...
1
vote
1answer
19 views

TCL/Expect script with if/else logic based on host IP address

So I have been using and enjoying /usr/bin/expect for scripts because it can quickly log me into servers since it autocompletes my userid and password. Through some cursory reading, I've come to ...
0
votes
0answers
31 views

Is there a script to restore deafult icon folder in Win7?

I work a lot with pdf files, but whenever I change the content of a folder the icon default doesn't change, so I have to "manually" restore default folder icon through the folder properties (customize/...
0
votes
1answer
26 views

How to run shell script from another as root on CPU cores?

I have a script (A.sh) which runs another script (B.sh), in which I need a root password to launch a command. A.sh: #!/bin/bash script=./hping.sh taskset -c 0 $script > ./test.txt & taskset -...
0
votes
0answers
26 views

OS X: Terminal command to check a file's default application

I'm writing a script which opens some files, in their default applications, via the open command. Before I actually open a file, though, I'd like to check which application is listed as its default ...
0
votes
0answers
25 views

Installing Anaconda packages creates virtual environments

In Ubuntu, after I installed nbextensions with pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master my command prompt switched from user@machineName:~$ to (base)...
0
votes
0answers
6 views

Android sendevent command not work until finger touch once [migrated]

I want to use sendevent command to simulate touch event, I followed this link, and it works. Use getevent to record, then use sendevent to repeat them, code like below, it can tap position 540 1802. ...
0
votes
1answer
30 views

Bash scripting: how to iterate through all drives?

I have buildroot readonly bootable image, which is normally loaded via TFTP in PXE enviroment. Filesystem in unpacked into ram and remounted as rw. And accidentally I wished to boot it from a USB ...
0
votes
1answer
13 views

How to get the latest commit date of a file from a given github reposotiry?

Given a file in a Github repository such as https://github.com/user/project-name/blob/master/filename, and I wrote a shell script (or a function in a shell script) to download this file called ...
-1
votes
2answers
47 views

delete files older than 10 days and store the deleted file details in another file

I want to delete directories and subdirectories older than 10 days. Also, I want to store the deleted folder and file names, time details in another file. So far my script is to delete directories, ...

15 30 50 per page