Questions tagged [shell-script]

Questions about shell scripts, executable files that are interpreted by a shell (bash, zsh, etc.).

Filter by
Sorted by
Tagged with
-1
votes
1answer
500 views

Shell script does not run java, wrong parameters

I wrote a program in Java, which uses the RXTX serial port, so I had to include an additional library. At first I ran it from SSH, and it was working properly. After that, I was running some test ...
-1
votes
2answers
53 views

Copying files while maintaining file attributes

Say, if I want to copy /etc/bin to a folder while maintaining the file attributes as well as parent directories. [The target folder should not just contain bin folder but /etc/bin.] Is the possible ...
-1
votes
4answers
479 views

SQL operation on csv file using bash or shell

This is my input file 0164318,001449,001452,001922 0164318,001456,001457,001922 0842179,002115,002118,001485 0846354,001512,001513,001590 0841422,001221,001224,001860 0841422,001227,...
-1
votes
1answer
49 views

Why does using array and for loop breaks line into 2? [duplicate]

Why does the following gives the line I am searching: grep '<appointment-id internal:ref=1.2.3/>' test.xml OUTPUT is <appointment-id internal:ref=1.2.3/> While the following breaks ...
-1
votes
1answer
64 views

How to record numbers of array elements based on selection comparision criteria

I have many files which has many 2x2 arrays. In the present example I show only one file (file1) Input file(file1): 1: 6.1703 541.631 46.0391 2: 6.1930 537.446 45.9239 3: 6.1931 177.171 288.579 ...
-1
votes
3answers
233 views

Redirect nohup-heredoc stdout to stdin, to execute directly?

I aim to paste this heredoc script and execute so to install and timeout-uninstall PHPmyadmin after 2 hours, from security reasons. nohup bash -s -- $$ <<'EOF0' & #!/bin/bash -x apt-get ...
-1
votes
1answer
66 views

Correct way to call a Bash function from all sessions

I use Ubuntu with Bash and I have a file hosting a script with 5 functions. Sometimes I want to call some function of these functions (but not all of them), directly from the CLI. I could say it's ...
-1
votes
1answer
413 views

How to automatically .tar a directory once it's moved to a folder [closed]

I need an .sh shell/bash script that will automatically tar a directory with the same name of the directory when I move the target directory into another directory (destination directory), So for ...
-1
votes
1answer
61 views

Cant use while loop because it is taking time is there any way faster way to get the final file..in linux [duplicate]

cat file_1.txt 100 200 name 100 200 100 200 150 300 150 300 150 250 150 250 150 300 name final file should be 150 300 150 300 150 250 150 250 i am using this command cat file_1.txt | ...
-1
votes
1answer
443 views

I'm trying to prevent the execution of a command in BASH.. Doesn't work always [closed]

This is based on another question of mine I am trying to prevent executions of certain commands using a script. I got the script to work perfectly in interactive shells but for non interactive shells ...
-1
votes
1answer
262 views

How to sort and join files in linux with huge data and print blank values for the values which are not found

Consider the below files : file1: 1 2 3 4 file2: 2 3 6 9 expected output: 1 NULL 2 2 3 3 4 NULL NULL 6 NULL 9 I have tried paste file1 file2 | sed 's/\t/\0\t/g' | column -s $'\t' -t ...
-2
votes
1answer
84 views

What does this mean? (question about print and \c) [closed]

I understand what this command is saying or doing but I want to know what the :\c means? print "Running Tests (this might take a while):\c"
-3
votes
3answers
548 views

Print lines containing at least all vowels in any order but no consecutives

The problem is to write a script that takes a file as argument and prints all the lines that contain -at least- all the vowels , -regardless of ordering-, but with [no two same consecutive vowels]. e....
-3
votes
4answers
564 views

How can I check that two input values are correct in a bash script?

I am writing a bash script and want to add some simple validation tests. The input should be either 1 or 2 and the script should ask for input again until the correct input is given. I was thinking ...
-4
votes
3answers
62 views

What does this command mean? (IO redirection question) [closed]

I am trying to figure out what this command is doing: rm OUTPUT/* >> log_${ENV} 2>&1
-4
votes
3answers
3k views

How to download all files of a GitHub project with wget (in raw form)? [duplicate]

How to download all files of a GitHub project with wget? All files should be downloaded in their raw form. Already tried: wget -P ~/ https://raw.githubusercontent.com/u/p/b/* wget -P ~/ https://raw....
-5
votes
2answers
4k views

Find files that match a certain size and modification time?

How can I find all the files in directory greater than a certain size, say, 15 KB, and which have been modified in the last 10 days?
-12
votes
2answers
169 views

bash shell script that creates directories [closed]

Write a Bash shell script program which creates 3 directories dir1, dir2, dir3 and then places the following files into each directory file1, file2. file1 is a zero size and file2 has the current ...