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
22 views

How to delete all directories except last 2 directories and the symlink pointed to those directories

I have below directory structure. drwxr-xr-x 5 ec2-user ec2-user 4096 May 22 07:03 TEEST drwxr-xr-x 5 ec2-user ec2-user 4096 May 24 05:33 BEE-TES drwxr-xr-x 5 ec2-user ec2-user 4096 May 24 10:53 ONE ...
0
votes
0answers
50 views

Automator - Render multiple PDF as JPG, each retaining PDF name

I need to render many 10-page PDF documents to JPGs. I can run a workflow to yield sets of JPGs, each retaining the name of the original PDF. The problem is that they are automatically numbered ...
0
votes
1answer
22 views

Rename-LocalUser not available when Intune executes

I have a configuration script that I want to run once during an Autopilot install. I've implemented this using the Device Configuration - Powershell scripts. I've turned on transcript and get this ...
0
votes
1answer
16 views

systemd service not executing the script?

My systemd service is as follows. /etc/systemd/system/caportal.service [Unit] Description=@CPACK_PACKAGE_DESCRIPTION_SUMMARY@ Before=network-pre.target Wants=network-pre.target DefaultDependencies=...
0
votes
0answers
13 views

How to read a file and send email to Recipients

I am really hoping someone can help me out with this. I have a text file with about 30 email addresses. The file will change every day. I want an easy command-line way to read the file and blind copy ...
1
vote
1answer
35 views

File descriptor opened once but closed many times; why the discrepancy?

I was trying to use process substitution and come across the following example: exec 3>&1 tar cf /dev/fd/4 $directory_name 4>&1 >&3 3>&- | bzip2 -c > file.tar.bz2 3>&...
0
votes
0answers
12 views

How to copy a list of files distributed across sub directories, by reading file names stored in array format in Mac OS?

I am using Mac OS High Sierra. Files are stored in 5 child folders inside a parent folder with name 'All files'. I have stored the list of files in a separate file called 'listOfFiles.json', in ...
0
votes
1answer
77 views

Mapping network drives with script

I'm attempting to use a script to unmap a drive clear the cached credentials used to map that drive map the drive again using different user credentials. In Windows 7 the following script ...
0
votes
0answers
6 views

Move files to specific location from one s3 bucket to another bucket

I have two s3 buckets in same account. One bucket having multiple images with name with 00000-file01.jpg 11111-file90.jpg 12321-file33.jpg 12345-file80.jpg 55555-file29.jpg Second bucket has some ...
3
votes
1answer
43 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
19 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
76 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
28 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
37 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
87 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 ...

15 30 50 per page