Tagged Questions
0
votes
2answers
21 views
Using two variables in a loop to access two diff file types in the same folder shell scripting linux
I am trying to call two diff files types in a loop.
I have a1.in-a10.in files and b1.out-b10.out files.
I wanna access both files simultaneously. I dont want to use nested loops but simultaneously.
...
1
vote
2answers
9 views
Create output file names based on input file name with autonumbers shell script linux
I need to automate a process using a script and generate output files similar to the name of the input files but with some additions to it.
my process is a Java code. two input arguments and two ...
0
votes
0answers
9 views
Passing parameter to FTP macro
I have developed a bash script that contains an FTP invocation.
Because the actions i do are based on a routine i have added a macro inside the .netrc
file in my home directory.
This is a small ...
1
vote
2answers
19 views
Finding max lines in a file while printing file name and lines seperately?
So I keep messing this up and I think where I was going wrong was that the code i'm writing needs to return only the file name and number of lines from an argument.
So using wc I need to get ...
2
votes
5answers
59 views
File with the most lines in a directory NOT bytes
I'm trying to to wc -l an entire directory and then display the filename in an echo with the number of lines.
To add to my frustration, the directory has to come from a passed argument. So without ...
0
votes
2answers
26 views
Erroring out for passed argument less than 1, what am I doing?
I'm trying to get a script to echo a message when a number like -9 is entered.
The arguments have to be passed from the command line
This is what I have now.
#!/bin/bash
#Assign1part1
if (( $# != ...
0
votes
4answers
48 views
Shell Script for counting down passed argument
So I was working on a project tonight and assumed based on my poor understanding that the requirement was to create a script to take a number and count down to 1 with commas on the same line.
A few ...
2
votes
3answers
36 views
How can I return grep results one line at a time in order to use the parsed data in another script?
I have a script that I use at work that I'd like to expand on a bit. The script I'm currently using takes an IP address as an arg and pushes a zip file to a specific directory on that device. The ...
0
votes
1answer
32 views
shell script taking last empty line of a file also
I have a script:
#! /usr/bin/ksh
TODAY=$(date +%Y%m%d)
list=$1
FILE_NAME="IMEI.txt"
OUTFILE="${list}_list.out"
##########################################
if [ -z ${list} ]
then
echo "Use the ...
1
vote
0answers
38 views
How do I make an alias work when I need to invoke more than one binary in the same command? [migrated]
Say I have two binary files: binary1 and binary2.
Each of them has its own option set: options1 and options2.
Users need to invoke a command that follows this structure:
binary1 options1 binary2 ...
1
vote
3answers
46 views
Command not found when running swapon with SSH [closed]
I'm trying to use "swapon -s" remotely but getting "command not found"
$ ssh ns2 swapon -s
bash: swapon: command not found
Using it locally works perfectly, what could be the reason for this?
0
votes
1answer
44 views
Searching through multiple directories in bash
I'm trying to figure out how I would search through multiple directories, defined with pushd, in order to find the disk space of the folders in the list, as well as whether any of the folders are sym ...
-1
votes
1answer
35 views
How to combine Case with shift and add results in a list in bash
When I write parameters they should be checked in a case and then added in a list if u type -c in front the parameter should be in uppercase and if u type -4 the parameter should appear 4 times
...
2
votes
3answers
59 views
Clearing archive files with linux bash script
Here is my problem,
I have a folder where is stored multiple files with a specific format:
Name_of_file.TypeMM-DD-YYYY-HH:MM
where MM-DD-YYYY-HH:MM is the time of its creation. There could be ...
1
vote
2answers
58 views
awk script to process 400 .txt files
I have a nice .awk script that takes the 2nd $2 value and prints it. Because the data in the .txt files only go down 8192 lines, any lines after that are irrelevant (the script takes care of that.) I ...