Questions tagged [shell]

A shell is software that lets users interact with the operating system, usually by typing at a command-line.

Filter by
Sorted by
Tagged with
0
votes
0answers
12 views

Disable any non-user changes to screen window titles with zsh

I upgraded my shell to ZSH recently on OS X and one behavior is driving me nuts. I've tried a few suggested fixes and haven't figured it out yet, so I figured I'd try here. When I start a GNU screen ...
-1
votes
0answers
11 views

Transfer files from 1 machine to 2 remote

I have a network configuration with machine A, machine B and machine C (they are linux). The network is slow and I want to copy a big file from machine A to machines B and C. The particularity is ...
0
votes
1answer
30 views

What's calling my shell scripts?

i've been given the task to have a pals server download a news audio file at 4 given times over the weekend and put them into his webs audio directory. Don't stone me, here's what i came up with: #/...
14
votes
2answers
3k views

Why is 1>a.txt 2>&1 different from 1>a.txt 2>a.txt ? (Example shown)

Why does redirecting both STDOUT and STDERR to the same file not work, although it looks like the same as 1>[FILENAME] 2>&1 ? Here is an example: perl -e 'print "1\n" ; warn "2\n";' 1>a.txt 2&...
0
votes
0answers
44 views

Script for uninstalling device and reconnecting wifi

Without any luck in fixing a related problem with a certain hardware component and no successful solutions from the official ASUS support, I would be interest in automatizing the uninstall of the ...
0
votes
0answers
27 views

Script shell, awk, lines and columns

Can you help me to format this datas in multiple columns ? I have these datas on one column: John Patrick 6 4 5 7 1 2 40 15 MY CLUB And would like to have : John 6 5 1 40 Patrick 4 ...
0
votes
0answers
32 views

Why is conda activated by default in a physical linux session but not via ssh?

I have installed Anaconda python on my Ubuntu 18.04 machine. When I log in to that machine in a physical session, my default conda environment is activated by default. My prompt looks like this: (...
0
votes
0answers
8 views

Remap Caplock to ESC with MacOS shell

I'm writing a perosnal setup script for new Mac computers. Part of the process is remapping Caplock to ESC. How can I accomplish this from the command-line? Thanks
0
votes
1answer
29 views

tmux: username doesn't update in status bar when set using `set -g status-right`?

I want to display the username in the right-side of the status in tmux and have it update automatically when changing user using e.g. sudo -u. I attempt to do this using #(whoami): set -g status-...
1
vote
1answer
31 views

Lack of EFI shell on machine

I don't appear to have an EFI shell on my machine, there's no option to access it through my BIOS and it never shew up in rEFInd when I used it. Is there any way I could install one?
1
vote
0answers
19 views

Using a variable with sed to return a section in an ini file

I need to use a defined variable in a script using sed to return the contents between section titles of an ini file. The code I've come up with works only with hard coded titles. I want to be able to ...
1
vote
1answer
20 views

Fish: Concise way to output elements of list on separate lines

I am wondering if there is a concise way to output the elements of a fish list on separate lines. I know I can do e.g. echo $PATH | tr ' ' '\n' to achieve the desired output, e.g.: /usr/local/sbin /...
1
vote
1answer
61 views

How do I run tesseract (anything really, that requires write permissions, from a shell) on windows10?

I am trying to run tesseract on windows10 (home ed), but this question is really more generic. Sources and instructions to run the program are here. I am running a downloaded windows binary, not a ...
0
votes
1answer
23 views

systemd start at boot but it is stopped

I have developed a shell script : #!/bin/sh # do some treatment for i in `seq 0 10000`;do # do some treatment and create/write into log file done NOTE: my script work manually perfectly without any ...
2
votes
1answer
18 views

Capture matched pattern in a cp/mv command

I want to rename files that are named like db_backup_2019_11_22-12_13_00.gz to db_dump_2019_11_22-12_13_00.sql.gz. Is there a way to do this using pattern match? I mean like this: mv db_backup_*-*....
0
votes
1answer
22 views

Trying To Get My Regex Logic Right In a Find Command to Change File Names

Please forgive me, I'm a shell noob. I need to rename a lot of directories, and would usually use a GUI utility for this, but my server access is via SMB over two VPN's, there are tens of thousands of ...
0
votes
0answers
21 views

ConEmu + MSYS2 Zsh - works but no colors

I created a new console login on ConEmu that will effectively open a MSYS2 Zsh terminal. However, unlike the bash consoles I have (MSYS2 and GitBash) - the Zsh console does not have any colors on the ...
2
votes
1answer
21 views

What's the easiest way to prepend the current time to the fish prompt?

I'd like to see the current time in my fish prompt so that I can always see for example when I started the last command. I don't want to install extensions.
0
votes
1answer
32 views

How to make tcsh command correction more sensible?

tcsh command correction (the behavior enabled by set correct = cmd) has an annoying "feature" that I'd like to disable: if I execute a program, but have another program with the same name "nearby", it ...
0
votes
0answers
55 views

VSC Terminal does not activate conda environment, “conda init bash” command does not work to configure shell

[vsc terminal autorun1 This is what happens when I open up the terminal in VSC Studiocode. Conda and Python are fully functional on the system and also work in the terminal, while I am able to create ...
2
votes
2answers
66 views

Bash Script to delete oldest files but keep latest files including sub-directories

I'm trying to delete old files but should keep latest 3 days log files.i tried below command, ls -tr /home/httpd/htdocs/pathname/pathname/config//build/logs/apps/.log | tail -n +4 | xargs rm -- but ...
0
votes
2answers
52 views

Specify directory when using cp command

Is there any way of copying certain files out of a certain directory when I am not currently in that directory? For example, I am writing a shell script that copies files: cp \ /some/long123/random/...
0
votes
1answer
62 views

bash: cannot remove directory

I'm not able to remove the directory test: $ ls -al total 0 drwxr-xr-x+ 3 www-data www-data 0 Nov 6 07:11 . drwxr-xr-x+ 5 www-data www-data 0 Nov 5 13:57 .. drwsrwsrwx+ 3 www-data www-data 0 Okt 4 ...
0
votes
0answers
36 views

Shell Scripting and coding shortcut keys for a program in a Shell Script

I want to feed a program's active state (specifically a web browser) into another program (Magnet) and then automate the Magnet app to send 4 browser windows with specific URLs into all 4 corners of ...
0
votes
0answers
17 views

Appending multiple files of same filename in Linux

I have a requirement that I have multiples files in a directory with filename as "123US_TRL.12365.123Invoice.1017948832.20190821_10557561.INVOICE.CSV" "456US_TRL.12365.123Invoice.1017948832....
0
votes
1answer
48 views

Removing BASH continuation line prompt

I've been a pretty long-term user of Linux, Solaris and bash but have never found a solution to this problem. This must be pretty common so curious if others found a better way to do this. I am ...
0
votes
1answer
36 views

Move only a certain sub-directory to a new folder with shell script

I have a folder Accounts containing mail accounts, all of these folders have a folder Archive.folder. I want to move all of archive folders with a simple script to a new folder. I tried this so far: ...
1
vote
1answer
34 views

how i can cut the internet connection for 1 min by cmd or something else?

I’m testing a remote computer having an access to our server, some of the tests require to cut the internet in order to see a specific behavior for our tests. I’m using TeamViewer for this tests, I ...
0
votes
0answers
44 views

How to change the default terminal prompt location to the right side?

Basically i need to know how to switch the default side of the prompt on (linux) terminal (which is on the left side of the screen normally). I don't think anyone else attempted this, or even thought ...
1
vote
2answers
51 views

How to list all files of a directory along with an index to allow users to choose file by inputting the index number?

I have multiple files in a directory and I am working on a bash script to list down all the files along with an index next to them so that the users can choose which file to select on the basis of the ...
1
vote
1answer
55 views

Why does the dot command (source) not work on files without path in zsh?

I recently switched from bash to zsh. In bash, I used the dot alias . for the source command, e.g. . .bashrc It worked with . .bashrc, . ~/.bashrc, . ./.bashrc. However with zsh, the dot alias does ...
0
votes
1answer
83 views

Environment Files in Linux (Bash)

I have seen below files exists on system. Need to understand which all environment files are run in different scenario. /etc/profile $HOME/.bashrc $HOME/.bash_profile $HOME/.profile When we login ...
0
votes
1answer
42 views

ffmpeg says “pcm_f32be codec not supported in WAVE format” yet a file is created

I'm trying to create a sine wave in .wav using ffmpeg exactly like this S.E. question: How to generate a sine wave with ffmpeg? For some sample formats it's working good but for big endian encoding, ...
0
votes
1answer
43 views

How can I set my cmd prompt permanently in Windows 10

I know I can set this on the fly with the PROMPT command, but how can I set this for every console session?
0
votes
1answer
24 views

Bash shell in mac terminal and iterm2 don't honor proxy environment variables

I have a 2019 mac running MacOS 10.14.6. I've had it configured to use my company's corporate proxy for about a month and various command line programs such as curl, brew, and git behave as expected ...
1
vote
0answers
19 views

Tagging files in macOs Finder… quickly

I'm looking to create keyboard shortcuts to tag files in the finder... without using Automator. The goal is to rapidly quicklook and tag files. I'm imagining: cmd-opt-0 -> tags selected file "...
0
votes
0answers
14 views

How to pass outputs from multiple commands as inputs for another command?

I'd like to pipe the outputs of multiple shell commands as inputs for another command. For example: >>> ls folder1 folder2 >>> ls folder1 file1 file2 >>> ls folder2 ...
0
votes
1answer
31 views

ls -l listing directory list

Any idea why there are different output . Some of which are misleading -bash-4.2$ mkdir -p new_dir/sub_dir/under_dir -bash-4.2$ touch new_dir/sub_dir/under_dir/file.txt -bash-4.2$ -bash-4.2$ ls -rlt ...
0
votes
2answers
60 views

Run interactive shell within nested ssh connection in script

Suppose I want to connect to machine B via machine A. As I learned, there are multiple ways to achieve this, for example ssh -T -J user@machineA user@machineB << END_OF_SSH_CONNECTION # Some ...
0
votes
0answers
23 views

how to add the MySQL mysqlsh.exe to the Windows CLI console?

How do I add mysqlsh.exe to my path for Windows 10? C:\> C:\>".\Program Files\MySQL\MySQL Shell 8.0\bin\mysqlsh.exe" MySQL Shell 8.0.18 Copyright (c) 2016, 2019, Oracle and/or its affiliates. ...
0
votes
1answer
37 views

How to rename a directory starting with - and space in between?

The folder was renamed to '-Cadence NDA Extension- Signed 10.2.17.pdf' by mistake and now am not able perform anything on the folder. How to rename it to dicarta? I am trying this in UNIX Shell Script....
0
votes
0answers
31 views

Bash script - Show context switches & CPU usage of 1 process?

I'm trying to create a bash script which will show the context switch and CPU usage of a specific process, say firefox for this example. I will not be using PID as that can change, atm its setup ...
0
votes
1answer
35 views

Bash script - How do I redirect output from a bash script to a file?

So I have a basic file which shows memory usage, switches, threads etc and I want those results to be printed to a log file, a text file. At the moment I launch my command by typing "./file.sh 1 1" ...
0
votes
1answer
1k views

Cannot open Jupyter Notebook in the new zsh shell in macOS

I recently upgraded to macOS Catalina and it prompted me to upgrade to the zsh shell. But now when I try to run jupyter notebook, it says command not found. I tried looking for it in .bashrc but ....
1
vote
1answer
92 views

Script Shell - How to print out echo if two conditions are met? (Only numbers, exakt 2 conditions)

I'm new to shell scripting and are trying to learn the basics. I'm launching a script using the terminal such as "./scriptgoeshere.sh Argument1 Argument2". I want the script to print some echo, "...
0
votes
0answers
22 views

On Jenkins, a shell source command generates error

The following is called in Jenkis from the Execute Shell block in Jenkins sh ML_script.sh There are two files "ML_script.sh" and "abc.sh" The ML_script.sh sources the abc.sh to call a function in ...
0
votes
1answer
112 views

Run shell script on remote machine with SSH using local environment variable

I currently compute some environment variable on my local machine $FOO. Now, I have an SSH script which consists of a few commands, some of which use the environment variable $FOO, which is only set ...
1
vote
1answer
34 views

Simple if/elif/else bash program with READ

The following code always ends up in the else part - also if I enter "peter" or "root". I do not get a syntax error. What am I doing wrong? #!/bin/bash # Hello World bash script echo "What is your ...
2
votes
1answer
53 views

ColorDiff - change colors

Is there any way to change color scheme used for color diff ? By default it uses red and blue But i cant see blue on my LCD at all.... Id prefer eg yellow or green I think I read about some cfg file ...
2
votes
0answers
67 views

Change the working directory in registry shell open command

I need to register an application to a URI scheme and I want the application to run from different working directory, but I couldn't find a way to change the working directory directly in shell open ...