Questions tagged [bash]

Bash is a free shell for Unix-like operating systems from the GNU Project.

Filter by
Sorted by
Tagged with
0
votes
1answer
4 views

How to print directory contents on remote server to txt file, SSH?

Logged into a remote server with SSH, If I'm in a subdirectory with 50K images, how can I print this directory content (not absolute path ideally) into a txt file in the same directory?
0
votes
0answers
6 views

extend awk script for multiple lines in both text files and not if both files have just a single record

I CAN generate this 3.txt output AA;BB;CC;DD; from 2 text files. Both files only have a single record 1.txt AA;BB; 2.txt CC;DD;BB;AA; I use this awk script. BEGIN{ FS=OFS=";" } { for(...
0
votes
0answers
9 views

Library not loaded Error when compiling GLib on Mac OS Big Sur (11.0 Beta)

I'm trying to compile GLib on my Mac operating system right now. I know I usually use Linux for things like this, but this project demands the use of my Mac OS Big Sur. I 've already installed the ...
0
votes
0answers
12 views

Bash: execute command related on input [duplicate]

Sometimes I erroneously copy & enter file name into terminal, for example, instead of youtube-dl <some-link> I trying to execute <some-link> Just for now I wrote the script f like case ...
0
votes
1answer
15 views

Overriding calls of application/command in specific folder

I would like to run specific application in specific folders only. For example for vint application $ cd /workspace/vim-plugin $ vint ftplugin/terraform.vim Should run docker exec -i vim-plugin sh -...
2
votes
2answers
250 views

Why am I getting this error in my script? awk: script.awk:19: “ syntax error

I have 2 text files 1.txt AA;00000; BB;11111; GG;22222; 2.txt KK;WW;55555;11111; KK;FF;ZZ;11111; KK;RR;YY;11111; I try to generate this 3.txt output: AA;00000; BB;11111;KK;WW;55555;KK;FF;ZZ;KK;RR;YY;...
0
votes
0answers
17 views

Listing the number of x-character words from a file

Bash - I need advice on this. I need to list the most numerous five-character word in the file that is farthest from the alphabet. for example abcde tt hjh abcde jkfj hje zyzyz hh abca zyzyz jew jnf ...
0
votes
0answers
24 views

Detect SFTP Login And Perform A Web Request

I am running a SFTP server on Linux/Debian. What I want is to detect when a user connects to the Server and then execute a bash script on the server in which I perform a web request. In this web ...
0
votes
1answer
23 views

Find hidden files in non-hidden directories

Consider following directory structure: $ find m m m/f.sh m/.a I want to find hidden files in non-hidden directories with: find . -not -path "*/.*" -and -name "*.*" . ./m/f.sh ...
2
votes
1answer
11 views

Make zsh history search behave like bash reverse-i-search

In bash, pressing [CTRL]+[r] will open the reverse-i-search prompt. How can I search the zsh history in a similar way? Note: The search query will hit the middle of the full command only, instead of ...
0
votes
0answers
11 views

On two separate Debian installs on a SanDisk MicroSD card, both times, bash and only bash always segfaults

I've recently installed Debian on a 64 GB MicroSD card via a USB adapter. I've done this twice, first using the KDE Plasma live-image for Buster and then the LXDE live image for buster. After ...
0
votes
1answer
22 views

how to give a variable value is empty in bash scripting

I'm trying to export 2 dashbords into two different files, Here in the loop 1st dashboard id is reading and value is storing {ES_HOST1}, then the {ES_HOST1} coming into empty, then in the loop 2nd ...
0
votes
0answers
45 views

vi command line editing insert mode overwrite

I'm using Windows Terminal (TERM=xterm-256color) in a bash shell under Ubuntu: uname -a Linux xxxxxxx 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux I'...
0
votes
1answer
86 views

Read console output without redirect or pipe

Is there a way to read a command’s console output without redirecting or piping its STDOUT/STDERR? The problem with redirects or pipes is that some commands behave differently when their STDOUT and/or ...
1
vote
1answer
14 views

sed, passing capturing group value to subcommand

Consider following example: echo abc=123 | sed "s/\([^=]*\)=\(.*\)/\1=\2/" outputs abc=123 ie. the same as input. We matched everything up until symbol = as capturing group 1, and ...
1
vote
1answer
31 views

How can I sort an email alphabetically in bash

I am trying to sort a list of emails in alphabetical order in bash to no avail The emails involve numbers and periods: kori.flap10@flap.com flap39@flap.com flap.flap@flap.com flap@flap.com k.slick20@...
1
vote
0answers
30 views

merging with format ;string;

I repost my question hoping to provide now a minimal reproducible example Is basically doing a merge of the two files with format NAME;URL;? Not exactly, string is not required to be a URL, it is ...
0
votes
0answers
17 views

Unable to open a new pane or window in the current directory in tmux

While using tmux version 3.1c, whenever I try to split the current pane into a new pane or a new window I get the following error shell-init: error retrieving current directory: getcwd: cannot access ...
0
votes
0answers
7 views

How to set log line length and overflow to new line?

I am using GeekTool and outputting log file content. The lines are very long. I would like to get the same experience as viewing the log in Console, where lines are wrapped when adjusting the window ...
0
votes
1answer
21 views

Try to setup static IP on CentOS

I am very new to Linux based operating systems. I can navigate terminal a little, I know how to "VIM". I am trying to give my machine a static IP. I need to get into and save an edited file ...
2
votes
0answers
76 views

bash script works really slow after updating Mac OS from Mojave to Big Sur

Yesterday I updated my MacBook Pro Mid 2015 from Mac OS Mojave to Mac OS Big Sur, and today I have noticed that my bash script for stress-testing C++ programs works really slow. My script runs this ...
-1
votes
0answers
40 views

Tool/Script to backup profile and aliases for multiple platforms [closed]

You know, as time goes on, I have more and more workspace customizations, like Aliases, Git Aliases, CLI Tools, oh-my-something and so on. I'm using these aliases for both Windows and Linux. Today, I'...
24
votes
3answers
2k views

Keep running command until output differs from previous run in Bash

I have a script I want to run every x seconds until the output changes. With a simple while or until loop, I know how to check the output for a particular string using grep, but what I want to do is ...
0
votes
1answer
327 views

Switch to active cmd window for typing

I've tried searching high and low for an answer by amending my title and reading questions before submission to no avail. I'm learning bash shell through Ubuntu LTS via windows cmd terminal using ...
0
votes
0answers
13 views

How to execute .sh file on Windows using Cygwin64

HI Imy trying to compile nms with comand ./make.sh but it wont work. So i was searching and found question here where people said using git for windows should work. So i tryed run ,,right click" ...
0
votes
1answer
20 views

Linux Sudo NoExec breaks timeout command

I've been battling sudo into getting /bin/timeout to work alongside another permitted command. For instance, what I'm trying to do is: john ALL=(ALL,!ROOT) NOEXEC:NOPASSWD: /bin/timeout, /bin/xx then ...
0
votes
0answers
7 views

Git Bash - invoking application “ImageViewer” results in “Permission denied” error

In linux, I use an application called "feh" to show an image from the commandline, and I found what I thought to be a similar application for Windows 10, Simple Image Viewer https://github....
1
vote
1answer
54 views

How to pass all arguments to a script called by /bin/bash

I have a script that I want it to receive a number of variable arguments and pass them to the execution of another script, but I'm only being able to pass the first argument set by the first call. My ...
0
votes
1answer
64 views

ctrl-x-e without executing command immediately

It's very handy that you can type complex commands in the $EDITOR (vim in my case) with ctrl-x-e. However, in my opinion it would be even better if the command were not executed immediately but rather ...
2
votes
2answers
37 views

ZSH alternative to BASH export VAR+='…'

I'm a Zsh user and I've encountered a problem I don't fully know how to solve: If I append an env variable within my zshrc [BB_ENV_EXTRAWHITE], which works in Bash, I receive a parsing error: export ...
0
votes
0answers
40 views

When script carries common strings from rows, lines are truncated

I have this script BEGIN { OFS=FS=";" } ARGIND == 1 { map[$2] = ($2 in map ? map[$2] OFS : "") $1 next } { r = $0; for (i=1; i<=NF; ++i) if ($i in map) ...
0
votes
0answers
24 views

Clear display of specfic command

Can you clear the output of specific past commands ? For example, 3 commands ago you did a CAT on a large file and now its content is useless, can you clear it to see only the previous commands ? ...
0
votes
0answers
59 views

Using Udev to restart service

I wand to use my 3Dconnexion SpaceNavigator with FreeCAD, to do so I followed instructions here : https://wiki.freecadweb.org/3Dconnexion_input_devices It works well, but I need to restart spacenavd ...
1
vote
1answer
43 views

Understanding Operators in find command

[kony@HOSTNAME testing]$ pwd /apps/kony/fmw/testing [kony@HOSTNAME testing]$ touch SCCS [kony@HOSTNAME testing]$ touch NOT_SCCS [kony@HOSTNAME testing]$ [kony@HOSTNAME testing]$ find . -name SCCS -...
0
votes
0answers
24 views

SSH isn't working when using password authentication

I have been trying to ssh tunnel to a virtual machine on my computer, and I have been trying for over 2 days now to get it to work. I have a virtual windows running on my mac, and I have started the ...
0
votes
0answers
19 views

Cat awk command additional code implementation

I want to understand how to use awk cat command because I think to do not understand In this page he suggest me to use his code You should process g2.txt first like this: cat join2.awk BEGIN { OFS=...
0
votes
1answer
14 views

Setuid , Setgid and Stickbit in Linux

Dears, I am learning linux permission and am perplexed trying to understand setuid , setgid and stickybit. Is my below understanding correct. Setuid :- Files :- When setuid is set on an executable ...
0
votes
2answers
135 views

How to changing the language of cmd terminal (chcp is not working)

I am writing a script that is responsible to read command output from Windows terminal. The intent is to read the command line output using the command "sc query <service_name>" and ...
5
votes
2answers
493 views

Why doesn't process substitution work with VLC playlists?

Does what I expect cat <(shuf my_ordered_playlist.m3u) echo <(shuf my_ordered_playlist.m3u) vlc my_ordered_playlist.m3u Does not do what I expect vlc <(shuf my_ordered_playlist.m3u) What ...
4
votes
2answers
238 views

purely command-line operation of dropbox

Is it possible to make use of dropbox account from purely command-line solution e.g a bash script? I have so far failed to find a comprehensive answer to this question. I have used Git for sometime ...
1
vote
1answer
34 views

Mintty terminal emulator: how to use “Image screenshot export”?

I'm programming in Bash (Git BASH) on Windows Server 2012R2. From within my bash scripts, I would like to make a Screenshot of the mintty window, I'm running in. According to https://mintty.github.io/ ...
0
votes
0answers
27 views

bash: C:Usersha_haAnaconda3/etc/profile.d/conda.sh: No such file or directory

I am using Windows. Whenever I launch git bash I get the following error message bash: C:Usersha_haAnaconda3/etc/profile.d/conda.sh: No such file or directory I think some of the path separators are \...
0
votes
1answer
38 views

Why isn't `chmod` command functioning in Kali Linux 2020?

I am basically really new at Kali and I have no previous experience in other OS other than Windows. I am trying to learn Kali using various tutorials on Youtube and I was basically learning ipsweep (I ...
0
votes
0answers
11 views

exit sway and start i3

As my primary wm I use sway, but when gaming with steam I run into some issues starting the game. So for the time being I use i3 for gaming (sway devs already on this https://github.com/swaywm/sway/...
-1
votes
0answers
33 views

AWK command does not join two outputs normally

I have a simple task to JOIN of output from LSBLK command and of DF command. Which field, I am planning to JOIN ? I am planning to JOIN via Mount point. Which output, of DF ? df -P --exclude={tmpfs,...
0
votes
0answers
25 views

Not the same output of small bash-script on different Linux systems

I have a small script, that makes JOIN of LSBLK and DF commands. Script: lsblk -n -b --output KNAME,NAME,SIZE,MOUNTPOINT | egrep -v "fd0|ram|loop|sr0|hdc|cdrom|[SWAP]" | while read kname ...
0
votes
0answers
21 views

Start Git Bash profile in Windows Terminal from bat file and pass in an executable command to run

I am trying to start 2 applications (client and server of a MERN stack app) in Git Bash using command-line arguments for Windows Terminal. Below given is my command wt -M; new-tab -p "Git Bash&...
0
votes
1answer
36 views

Solved-How to bulk rename IMG files in Windows

I'm trying to organize my family's media library, and I'm trying to take filenames such as IMG02003932(23421-2345) and get it just down to the numbers in the middle. I think what I am ideally looking ...
0
votes
1answer
42 views

Cron job fails to run NodeJS script

I have a cron job for which I want to log output. The cron file (crontab -e) is: 0 7 * * * node $HOME/server/task.js >> $HOME/server/log.txt The cron task is called: $ grep CRON /var/log/syslog ...
0
votes
0answers
54 views

Custom expansions with tab

It is very comfortable to use the tab for completing commands and arguments in bash (and probably other shells too) I would like the option to have a way of specifying some predefined expansions that ...

1
2 3 4 5
207