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
2
votes
1answer
51 views

Why does this shell script with sbcl --version print a newline before the echo output?

The following script prints a newline before the first word printed by echo. Why? Environment: macOS Mojave using either system sh (which is GNU bash 3.2.57(1), or GNU bash 5.1.8(1) Description ...
0
votes
1answer
38 views

How to access positional parameters from within a for loop

My shell script contains a for loop. The script makes use of positional arguments via $1, $2, $3, etc. However, trying to access these parameters from the for loop using something like this: for i in &...
0
votes
1answer
40 views

Copy a jpg file to another folder bash script unix

The code I have written has some errors: cd OS2/OS22 for f in *.jpg do cp -v "$f" OS! "${f%.jpg}" done It says: cp: target 'photo' is not a directory. *Can someone please ...
0
votes
0answers
11 views

Is there a work around for how sending standard error to /dev/null affects the behavior of tput?

The script is very simple. Use tput to query the number of columns available. dacracot@nep-vm1:~ $ cat columns.sh #!/bin/bash # determine how many columns are available TERM_COLS=$(tput cols) echo &...
0
votes
0answers
20 views

The term 'apt' is not recognized as the name of a cmdlet

I'm new to this. While running yml in gitlab CI, I encounter this error (Windows local) apt : The term 'apt' is not recognized as the name of a cmdlet, function, script file, or operable program. ...
0
votes
0answers
9 views

Cloud supervisor for IoT-like devices [closed]

Can anyone recommend a cloud or hosted supervisor solution for GUI Linux boxes, almost like Balena Cloud, but with ability to install supervisor on ton of regular Debian-like Linux distro? I look for ...
0
votes
0answers
25 views

How to enable Fish shell themes from ssh connection

So, I’m learning to transition to using the Fish shell. I’ve only ever used the Bash shell, but I’ve enjoyed using Fish. I found this custom shell theme called “Shellder” (https://github.com/...
0
votes
1answer
23 views

zsh - how to go back to previous directory?

i just bought a new mac book. in my prevous mac with zsh i was able to do the following command to go back to the previous directory: zsh: - in bash this would be : cd - but now in zsh although ...
-2
votes
1answer
14 views

Can't figure out why a cron job isn't working

I have an odd situation where I have a cron job set up to execute a shell file once a day, and based on the syslog the cron job IS being called as intended, and by the proper user that should be ...
2
votes
1answer
42 views

/dev/tcp/hostname/80: as an interactive session?

Does anyone know how to obtain an interactive session with the device /dev/tcp/hostname/80? I opened using cat <> /dev/tcp/www.google.com/80 and tried typing in 'GET / HTTP/1.0\nHost: www.google....
0
votes
0answers
11 views

Ansible win_shell system cannot use the file specified

I'm trying to use winget command through ansible win_shell module, but machines keep telling me that "System cannot use the file specified.". When I check the location of the exe with (Get-...
0
votes
1answer
17 views

Split and add new string between string to rename the path in sftp

I have a file which contains paths. I want to loop over the file and change the path. I want to change path from /dir/file1.txt to /dir/temp/file1.txt while read p; do # update the string from /dir/...
0
votes
0answers
10 views

Send to > Mail recipient missing even though Mail Recipient.MAPIMail is present

I have a problem - on a certain copy of Windows 10, Mail Recipient is missing from the Send to menu. Solutions on the Internet mostly explain that the Mail Recipient.MAPIMail file (with the text ...
0
votes
1answer
25 views

Changing default startup directory in CygWin and using alias

Following this post : How do I change the default startup directory in Cygwin? I was able to change the default directory by editing the .bashrc file. I was curious about the alias : I created the ...
1
vote
1answer
19 views

How to safely kill bash/zsh/other shells with its history stored?

Shell programs do not react to SIGINT, so kill $(pidof shell) can not kill them. When I use kill -9 $(pidof shell), the shell immediately exited as I expected, but the history in the session is lost. ...
1
vote
1answer
30 views

Make application available across all shells

I have developed a java application that i want to publish to my users. This application is an ancillary application used by many different shell scripts, such as sh, su, bash and zsh to name a few. ...
0
votes
1answer
25 views

List of JSON strings as command arguments

I've been working with GitLab CI recently to automate some busy tasks, namely auto releasing binaries for version tags. For those who don't know Gitlab CI, it is very straightforward. It pulls the ...
0
votes
0answers
45 views

Script Shell, integer expression expected

I have to write a script that takes one argument (a directory name) If the number of arguments is more or less than one, the script prints an error message containing instructions how to use the ...
0
votes
1answer
26 views

SHELL=“/bin/bash” vs SHELL=“bash”

What's the difference between exporting SHELL="/bin/bash" and SHELL="bash"? I previously had export SHELL="bash" in my .bashrc. It seemed to work. $($SHELL) spawned a ...
0
votes
1answer
43 views

How to run multiple shell commands one after another in Windows batch script?

I tried using '&' as most of similar posts suggest but this doesn't work: @echo off call variables.bat // contains port numbers and notebook address ssh user@remote_server "jupyter notebook --...
0
votes
1answer
22 views

R and shell in macOS Catalina

I just got a new M1 mac with macOS Catalina at my workplace, and I'm having trouble when running R from the command line (actually, when running it from a Makefile). I'm relatively new to the shell so ...
0
votes
0answers
37 views

How to give Users SUDO Permission from Bash Script

I have found a link (Bash Script) through which we can create Users in Linux. Problem is all the Users created from this script does not have SUDO Permission (root Permissions). Please help, Which and ...
0
votes
1answer
22 views

Shell-based (Terminal) methods for viewing or tailing Windows logs (events)?

I would like to "tail" Windows system logs and other such logs via a shell (in Terminal) in Windows. I don't want to use traditional window log viewing methods such as Event Viewer or even ...
1
vote
1answer
28 views

Is there a command for setting unbuffered stdout and stderr in Windows batch?

I want to setup a command with unbuffered stdout and stderr. In Unix system, it can be achieved by using stdbuf -o0. For Python scripts, it can be achieved by using python -u. What is the equivalent ...
1
vote
1answer
24 views

Red Hat Linux Play Sound File From Service Account

I am trying to have my service account play a sound when a problem occurs, I have figured out how to get a script to run when I want to, but the problem is that the play command won't work. From the ...
1
vote
1answer
21 views

MacOS - How to use terminal with 'set -o emacs'?

I like to do a lot of work in a shell and I usually setup the shell to use emacs keybindings. On linux, it's just a quick 'set -o emacs' and I'm good to go. However, on MacOS, the solution eludes ...
0
votes
0answers
14 views

How to clear all proxies in a shell session in Linux?

My OS is openSUSE Leap 15.2 and I have system proxy set in YaST. But sometimes I need to do something without the proxy, unset {http,https,ftp}_proxy doesn't work so I need to close proxy in YaST and ...
-2
votes
1answer
48 views

Getting an error when attempting to install Homebrew on CentOS 7: “Error: Unknown command: shellenv”

I am trying to install brew on CentOS 7 and get the following error: [jalal@goku ~]$ git clone https://github.com/Homebrew/brew ~/.linuxbrew/Homebrew Cloning into '/home/grad3/jalal/.linuxbrew/...
0
votes
2answers
29 views

Output of 'date +%a' always in system-language?

Does date +%a output always the weekday in the system language? No matter if in bash, sh or cronjob
0
votes
0answers
19 views

How to paste from Windows into Ubuntu 20 shell in the cpanel of my website?

I am in the cPanel of my website and the hosting allows me to access the shell (Ubuntu 20). I cannot use simply CTRL+SHIFT+V to paste lines from Windows, Quick Edit Mode isn't active nor can I paste ...
0
votes
0answers
22 views

Use shell script to select created files in Finder?

I've found all kinds of results on how to do stuff with selected files in script. But I have a script set up as a service via Automator that already works to create symbolic links for selected files. ...
0
votes
0answers
18 views

Can't mount config partition on QNAP TS-431K

I asked this question over at StackOverflow and have been advised to better put it in here. I recently bought a QNAP TS-431K NAS, installed 4 harddisks and set it up as a RAID. Then I configured the ...
1
vote
1answer
37 views

How does a Unix program know to change output if it's being piped?

Calling something like ag (a grep alternative) results in an output that's human readable. Results are printed with headers. Useful for humans, horrible for programs. $ ag 'filter\(' tests/...
1
vote
1answer
55 views

Cannot delete folder as superuser

There is a folder structure on a external harddrive created by some software a couple years ago that looks like this b7960f2d3fccff0ddb9dc9cb471b562d/xbox360/*unknown* I'm unable to delete the folder ...
0
votes
1answer
278 views

“/bin/sh: 1: MY_COMMAND: not found”

Error During docker build -t MY_IMAGE_NAME ., using a Dockerfile for a ROS project, at line RUN source /opt/ros/melodic/setup.bash the following error appeared: => ERROR [stage-2 19/19] RUN ...
0
votes
1answer
63 views

Bash - Multiple Commands across multiple lines

I have a long Bash command. This command looks something like this: grunt build && mv file1.txt ../../results && mv file2.txt ../../logs && mv file3.txt ../home && mv ...
1
vote
1answer
18 views

Print sections in text file using awk and shell variables

I have a text file, materials.txt, with a large number of material definitions similar to this: *FILESTART line_a line_b line_c *MAT_PLASTIC 1 property1 property2 property3 property4 ...
1
vote
1answer
28 views

How to invoke a bash script to run from another script via ssh connection

I have two scripts masterScript.sh and slaveScript.sh. The masterscript.sh is first executed on windows-PC and one of its commands is to establish a connection with the ubuntu-PC via ssh (e.x. ssh ...
0
votes
1answer
49 views

Find files from different directories with inclusion and exclusion of some

I want to find files from three different folders with certain files included & excluded. Folder 1: Path: /var/www/app/var/log/ Exclude only: file1.log & file2.log Folder 2: Path: /var/log/...
0
votes
0answers
29 views

OhMyFish does not show the hostname and computer name

OhMyFish does not show the hostname and computer name by default. screenshot Is there any way to change this setting so that it shows the hostname and computer name like how it is shown in the default ...
0
votes
0answers
25 views

How is Powershell/CMD able to handle text selection/copy with keyboard and not Linux Shell(BASH/ZSH)

I was looking for the reasons as to why something like (selecting a text with keyboard, copying it) is not inherently present in prompts of linux distros (regardless of which terminal app they ship or ...
0
votes
0answers
13 views

How do I configure fzf to return only a specific field of the selected line?

I recently ran into fzf, which seems like a fantastic little tool, but there's one thing I'm having trouble with: given input with multiple fields per line, how do I configure it to return only a ...
0
votes
0answers
18 views

Ubuntu/KDE: How do scripts called by Plasmashell/Shortcuts/.. behave?

[I use Ubuntu 20.04 with KDE Plasma 5.] I want to be able to run custom scripts on many occasions, for example triggering with custom Shortcuts, or triggering when I switch Activity (using pytivity in ...
1
vote
1answer
50 views

Bash not doing word expansion after command substitution

From GNU's Bash Manual Sections 3.5.7: Word Splitting: The shell scans the results of parameter expansion, command substitution, and arithmetic expansion that did not occur within double quotes for ...
1
vote
0answers
37 views

How to copy several files to various folders based on a source and destination list in eXcel? [closed]

How to copy several files from a single folder to different folders in windows having a source and destination list in eXcel? I have a folder with few PDF files. I want to move each PDF file to its ...
0
votes
0answers
23 views

Split a file into multiple files based on values from bookkeeper file

I have 2 files, where I need to split File 1 into multiple files of size specified by File 2 contents. Sum of File 2 contents will always be equal to size of file 1. There can be many entries in File ...
0
votes
1answer
49 views

How to delete a hard link in a directory without write permissions?

I'm configuring a snapshot daily backup based on this recipe: http://www.mikerubel.org/computers/rsync_snapshots/ To summarize, on the backup server I rotate the older copies by running: dir=...
1
vote
1answer
34 views

Why fish shell does not allow function named `-`

I am trying to use fish as my default interactive shell. I was previously using bash and there was support for alias named - (ASCII hyphen, 0x2d). Why does not fish allow creation of alias or function ...
1
vote
1answer
33 views

How to I persist prepended items to PATH in fish shell?

My PATH Prefixes Don't Persist I'm using Fish v3.2.0. According to the documentation, set -U fish_user_paths should persistently ensure that the directories stored in it should be looked up before ...
0
votes
0answers
20 views

How can I use a serial connection as an output for a shell?

I have a serial device (/dev/ttyACM0), which is connected to the serial port of a microcontroller. The microcontroller draws text that it gets on that serial connection to a screen. I want to use that ...

1
2 3 4 5
75