Tagged Questions
-2
votes
2answers
19 views
Trying to call a script while passing two arguments
I have a script that greps with $1 and $2, first argument being a pattern and second being a file.
I need to create another script that calls this first one, passes the two arguments to it, and if ...
0
votes
2answers
21 views
Attempting to pass two arguments to a called script for a pattern search
I'm having trouble getting a script to do what I want.
I have a script that will search a file for a pattern and print the line numbers and instances of that pattern.
I want to know how to make it ...
3
votes
4answers
26 views
Trying to create a file to call another file for a looped search
I'm attempting to write a script that calls another script and uses it either once, or in a loop, depending on the inputs.
I wrote a script that simply searches a file for a pattern and then prints ...
0
votes
1answer
18 views
Call a bash script whenever you enter a textarea anywhere on linux
I am getting an Asus Transformer Book TX300 soon which I will dual boot Windows 8 and Linux (probably mint). I am more concerned with enhancing functionality for Linux, so this is why I plan to do the ...
1
vote
0answers
46 views
Directory's disk usage list [closed]
Hello for my classes i had to finish this task
Problem 5.5 Directory's disk usage list
For indicated directory print a list of files and subdirectories in descending order according to their total ...
0
votes
1answer
13 views
bash command line arguments into an array and subset the array based on the parameter value
I am trying to get input parameters for my bash script.
testbash.sh 4 1 2 4 5 Science a p *
I want to get these arguments as an array which i used $@ to acquire all of it into a array. Now based on ...
1
vote
3answers
24 views
Number of arguments requirement input validation
Writing a script to search a file for a pattern and output the lines found with that file and the number of each line.
I have the script as
#!/bin/bash
echo "------ File =" $2 "------"
grep -ne $1 ...
4
votes
1answer
39 views
How do I catch permission denied errors from the glob operator?
The following simple Perl script will list the contents of a directory, with the directory listed as an argument to the script. How, on a Linux system can I capture permission denied errors? ...
2
votes
3answers
29 views
How to set bash next bash operation input equal to the output of the prvious operation?
I believe it is really easy, but I didn't find anywhere an answer for me. What I'm trying to do is:
echo file.war | sed s/.war// | rm -rf ???
to pass to the rm -rf the output of the sed command.
...
-1
votes
1answer
13 views
Issues with libnet installing [closed]
Im trying to install libnet, but I get these errors. http://pastebin.com/sC5dTQ7K
Please help me, I've been stuck on this for a while now..
2
votes
2answers
48 views
How can I programmatically send a blank password?
I have a shell script that checks out a subversion repo. The connection asks for a password (I know it's an unnecessary layer since the password is blank), but how can I send a blank password to ...
0
votes
4answers
40 views
Script is not replacing the prefix of filenames
I am trying to replace the prefix of all files in the directory with another prefix (renaming).
This is my script
# Script to rename the files
#!/bin/bash
for file in $1*;
do
mv $file `echo ...
2
votes
1answer
18 views
Printing grep results to file and terminal
I'm trying to display the grep results to the terminal as well as to a file. The solution I've come up with is to just run it twice, but this obviously will create efficiency issues.
grep -n ...
1
vote
2answers
53 views
linux bash script get user input and store in a array
I want to write a bash script that will get user input and store it in an array.
Input: 1 4 6 9 11 17 22
I want this to be saved as array.
0
votes
2answers
45 views
Find out how much SSH-connections currently exist [closed]
I'm using a simple Shell-script on my Linux-server which checks, if a rsync-job is running or if any client some directories from the server via Samba. If this is the case then nothing happens, but ...