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

-1
votes
0answers
18 views

Windows NT - screenshot script [on hold]

I have to create a script to take screenshots everyhour of the whole screen via cmd. I have to do this within a Windows NT. I tried to search software that can be launched sillently through the ...
3
votes
1answer
53 views

Add specific text in every blank line

I've a file as belowabcpqrxyzaaabbbcccI want to add specific text like "this is test" in every blank line like belowabcthis is testpqrxyzthis is testthis is testaaabbbthis is ...
0
votes
1answer
18 views

syntax error near unexpected token `>' in script run by cron

I'm writing a shell script for Mac OS/Linux. The script is run by a cron job. I'm trying to append stdout and stderr to a log file. My command(simplified) looks like this(line 5 in myscript.sh):...
1
vote
0answers
18 views

Find out the real path of a file from a SUBST drive

Is it possible to find the real location of a file, knowing its location on a drive created with subst? Example:> subst d: c:\dir\> real_path "c:\file"c:\file> real_path "d:\file"c:\dir\...
3
votes
1answer
44 views

Arg handling in a script for a modified “find” function?

I'm using FreeBSD and I understand and use the -prune option on find to prevent the command descending into a subdirectory. But I find the necessary syntax very clumsy and awkward. It also doesn't ...
1
vote
2answers
26 views

Replace slashes in a url

I'd like to replace all slashes from a web address.Example address: https://example.com/sub/folder/files/file.txtExpected result: example.com-sub-folder-files-file.txtI can strip the https but I ...
0
votes
0answers
12 views

How do I lock out a PCIe device easily?

I'm not looking for anything super complex like SRIOv, but just a semaphore.I have a build machine with mulitple concurrent users. I want to have a simple lock mechanism for a PCIe device (we have ...
-1
votes
1answer
51 views

Convert date to epoch format within a file for multiple entries using shell script

below is the format in a file. can anyone help in converting first two columns which is in date format to epoch format?2018-01-02 05:44:00,2018-01-02 05:59:00,1,702058496,0,0,0,0,0,0,0,02018-01-02 ...
0
votes
1answer
23 views

add text in multipule files recursivly in a spicific line

I want to add {% load static %} to the second line in all the html files in the directorythis is my folder structure.├── fullstack│   └── index.html├── git│   ├── 1.html│   ├── 2.html│   ├── ...
1
vote
1answer
70 views

How do I run the first n lines of a script?

I have a script file with hundreds of lines. Say I only want to run the first 10 lines. I could do head -n 10 file.script > file10.scriptchmod +x file10.scripthttp://superuser.com/file10.scriptI'm sure there ...
1
vote
1answer
51 views

Removal of duplicate PDF files based revision level in file naming system

I'm trying to create a batch, powershell, or anything a novice like myself could run easily to complete the following task. Any help would be greatly appreciated.I have a few thousand pdfs, in a ...
0
votes
1answer
14 views

Remote Copy of All Traits of a File Except for its Content

Everything described below is done via a Bash script.I desire to capture the state of a defined set of files on a defined set of remote hosts. The "state" of a file depends on the type of file:...
3
votes
1answer
80 views

How can I get bash command line completion to complete a partial argument and then provide more hints

Imagine I have a command 'command' which takes arguments foo:bar foo:foo bar:bar or bar:fooI can write a command line completion script that I can source into my environment to give me completion ...
0
votes
0answers
29 views

manage process on remote machine

we are run on Linux remote machine some scripts ,asssh $remote_machine "/tmp/ucrt.bash" &ssh $remote_machine "/tmp/urct.bash" &each script create PID and when script ended script return ...
2
votes
1answer
88 views

Rename inside the crontab file

I wanted to rename file name, putting in more details so that i can get my answer for my question:I have the below lines in crontab00 * * * * /home/@@@@/ulimit_nofile_status_20480.sh >> /...
0
votes
1answer
38 views

Bash Shell Script Option Processing: Add -all and -q (quiet), Enforce No Repetition

I've writing a Bash script that takes N options. Call them -1, -2, ..., -N. The following applies to use of the options:Any number of the options may be provided, from 0 - NNo options take any ...
0
votes
0answers
33 views

Checking for a file whether it is readable and regular in powershell

I'm new to powershell and I want to check if file in readable and regular. In unix we can do it by using -f & -r. For example the following shell script function accepts filename as argument and ...
0
votes
0answers
22 views

Keep getting menu errors in shell script- syntax error: “(” unexpected

I can't figure out what I'm doing wrong here. I keep getting an error back at the menu part. #!/bin/bash#streambox.sh echo "before we do anything-- we need to install some dependiencies"wait ...
2
votes
1answer
47 views

execute function in different shell

I usually zsh. I want to execute a function in bash and return back to my original shell. I can do this manually, but I want to automate it. How can I do that?For example, I am on zsh.I want to ...
1
vote
1answer
132 views

svcutil.exe is not recognized as an internal or external command, operable program or batch file

Looking to use SvcUtil.exe instead of the wsdl command.Where is SvcUtil.exe?thufir>thufir> ls 'C:\Program Files\'Directory: C:\Program FilesMode LastWriteTime ...
2
votes
1answer
120 views

Find all video files by duration

I want to move all video files with a certain duration to some directory. In this answer I found a way to probe the duration of a video file:ffprobe -i some_video -show_entries format=duration -v ...
1
vote
4answers
188 views

Do PowerShell cmdlets run on Linux dotnet? Or only Microsoft .NET?

Title says it all. Wikipedia says:Design[edit] PowerShell's developers based the core grammar of thetool on that of POSIX 1003.2.[21]Windows PowerShell can execute four kinds of named ...
0
votes
2answers
90 views

How to delete what's between two spaces or blanks using sed?

I got this pattern:ethernet-em1 016f2bbf-3268-4229-a25b-c7f94b6e52dc 802-3-ethernet em1virbr0 4fc0e260-b21a-4a9d-a74d-3ec9f124976f bridge virbr0what i want is to get ...
0
votes
1answer
48 views

How do I prevent sleep from getting confused

I run two scripts. Both are essentially the same code, but they need to run 5 minutes apart to prevent collision.First script:#!/bin/sh# First runline="Bonus check"stamp=$(date +%Y%m%...
0
votes
0answers
42 views

How to use Ash command in Terminal Emulator on Android

I installed Busybox in my device. Then I got an applet called 'Ash'. I googled a lot but I couldn't get any answers. Can anyone guide me how to use this applet.[![Screenshot Attached]!]
0
votes
0answers
51 views

Scripting dockutil

What am I doing wrong?I try to configure the dock with a shell script containing dockutil commands.it works without problems for System Preferences, Safari, TextEdit,Applications and ~/Downloads....
1
vote
0answers
26 views

pass in parameter for a shell script, but why are there two values?

I have some trouble with a shell script, pls help me, thx.I create a shell script file is named 'deploy.sh', and everytime I call this script with a parameter looks like '20180208','20180214'(...
0
votes
1answer
29 views

yum update shell scripting

I am new liunx Scripting can anybody help me with a script for yum update where we want to update all the packages linux without rebooting.(excluding kernel and important packages which require reboot)...
2
votes
1answer
180 views

executing a script via ssh, not real output

I am executing a script via ssh in this way:ssh user@host 'bash -s' < http://superuser.com/script.shthe problem is that, sometimes, the output that I get is not correct, the lines are mixed.In my case the ...
1
vote
1answer
26 views

Shell Script to look for all lines in a file having '500' in the 11 column taking too long to run

I wrote the following script as a practice :#!/bin/bashMyFile=$1while read p; doerror=$(echo $p | awk '{print $11}')if [ "$error"="500" ]thenecho $p...
2
votes
1answer
40 views

Why doesn't ulimit -n work when called inside a script?

This is very odd. I'm trying to set the ulimit to 60000 via my startup.sh:#!/bin/bashulimit -n 60000echo "Hello! File Descriptor set"I can execute this with http://superuser.com/startup.sh (755 file permissions) ...
-1
votes
2answers
39 views

bash + how to capture the requated field from variable

we set the variable with the follwing valuesMY_VAR=" one two three four"how to capture the first value from variable with bash? ( without using echo command ) expected output one
1
vote
1answer
256 views

how to use xmllint in order to get value from xml

I have the following XML file<?xml version="1.0" encoding="UTF-8" ?><!-- Component configuration file --><Component><Name>install_env</Name><HelpString>...
1
vote
1answer
72 views

bash + how to avoid specific messages in the log file

when I run the bash script on my Linux machine we get the following errors in my log , note - we set in the script:exec > $log 2>&1 , ( in order to send all standard error/output to $...
3
votes
1answer
48 views

How to use shell in ConEmu console for windows 10 when I enabled shell in developer mode?

I enabled the shell with this tutorial https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10But if I have a shell script named ca.sh in a project root directory, I still can'...
1
vote
1answer
28 views

How can I modify this inotifywait script to upload any file from any directory?

How can I modify this inotifywait script to upload any file from any directory?I am working on an inotifywait based script which should check for file creation and changes recursively in a directory ...
0
votes
1answer
66 views

Activate virtualenv using alias

I can activate my python virtual environment from it's folder by entering . bin/activate. I'd like to instead type a single word alias, such as shazam, from the home folder (or anywhere else) that ...
1
vote
1answer
165 views

How to batch create folder with same name as file and move file into folder?

I tried the method here, but it failed.I have test files and folders in ~/Desktop/z named n copy, n copy 2, and untitled folder.I cd'd to z, ran the command, then this was the output:How can ...
0
votes
1answer
36 views

Does set timeout change each expect statement, or just the final expect eof?

I'm learning to use /usr/bin/expect for the first time, to automate the nightmare that is installing fink from source, as that script has a few dozen prompts, all of which can be answered with the ...
0
votes
1answer
89 views

Shell Script email output formatting

I am trying to create a shell script that echo's a bunch of commands and have gotten it to send out emails fairly simply. {echo $(hostname)echo ""echo "Uptime" $(uptime)echo ""echo "...
1
vote
1answer
99 views

Manage space between words (.bat)

The question might not be so good to ask, but I am really not getting a workaround for same. I have a .bat file which connects UNIX (using PuTTY command line plink) server and further executes a .sh ...
0
votes
1answer
55 views

Can cron “cache” scripts it runs?

Caveats up front:1. My *nix knowledge is very limited but growing.2. This particular issue applies to SunOS 5.10 (I know) but I'd be interested in general answers.If a cron entry runs script ...
0
votes
1answer
62 views

Delayed execution on shell script

I made a simple script file on my linux machine to mount a iscsi drive.iscsiadm –m node --targetname THE_TARGET_IQN --loginmount /dev/sdb1 /home/mountedThe problem is, When I exceuted this script,...
3
votes
1answer
53 views

Looking for a way to notify a user if they have been disconnected from the internet for long periods of time

as the title says I am looking for a good way to send a notification to a windows user if the machine has been disconnected from the internet for long periods of time (14+ days).These are industrial ...
0
votes
2answers
46 views

File process print last 2 character of first columns and rest

I have input file having 11 columns and this files need to process, output first columns last 2 digits and print rest of columns. Fields are comma separated. I have tried some commands but not get ...
0
votes
0answers
51 views

Shell script monitoring files in folder

I made this script below #Monitoring the Inbound folderdirectory="/mount/data/PeppolICSInORG/$(date +"%Y-%m-%d")" number_of_files=$(ls -A $directory | wc -l)if [ "$number_of_files"=="0" ]; ...
0
votes
0answers
28 views

Unix - Automated MD5SUM Verification / Security reccommendations

This is my first post on here so go easy on me!I am currently looking into ways of securing a number of E-Commerce websites which serve a large amount of tragic each day. So far we have ...
1
vote
1answer
99 views

Getting AWK error while transpose some message content

I trying to transpose below text into single line with pipe separated, i getting some error if text is start with number% , what is the issue, any other command is there Sample content in txt file...
0
votes
0answers
50 views

Bandwidth throttling by executing custom script in router

Is there a way to imitate data fluctuations in mobile networks, like fluctuating between LTE, 3G and 2G, randomly or on a timed, via script using a router. I'm trying to study my apps performance in ...
1
vote
1answer
46 views

Parsing errors due to special characters in dns txt records

I have trouble parsing dns txt records retrieved by a script I wrote. The script takes a records, ns records and txt records and writes them to a .csv file. I am using semicolon to separate entries ...

153050per page