Hello, I am a new joiner to the forum, and have what i hope is a simple question, however I can't seem to find the answer so maybe it is not available within bash scripting.
I intend to use the below script to archive files from multiple directories at once by using a loop, and a variable (n) which increases by one each loop.
The problem is that when i connect two variables, if i define a variable with that output, it is not called, only the text is output.
Hopefully you can see what im trying to do and it will explain itself;
I am fairly new to scripting. But I have been able to extract and format all of my information required into one file. My issue is that one character is on a separate line. I need to be able to add the character to the previous line.
ex.
abcdefghi
1
bcdefghij
3
cdefghijk
4
need to... (4 Replies)
Hi Guys,
I am looking to optimze these 5 SSH lines to a single SSH to get my machine to not hang! lol!
cat hosts.lst | xargs -n1 -t -i echo 'home/util/timeout 6 0 ssh -q {} top -b > util/{}.top &' >> r_query_info
cat hosts.lst | xargs -n1 -t -i echo 'home/util/timeout 6 0 ssh -q {} uname -r... (5 Replies)
I can't believe I can't figure this out... given this code:
CARS_DATA_LIST=`cat /tmp/file1 | awk '{print $1}' `
FMSA_DATA_LIST=`cat /tmp/file2 | awk '{print $1}' `
The value of each of the above variables is:
CARS = a b c d e f g
FMSA = a b c q r s
I want to declare a third... (8 Replies)
Hello,
I have a problem combining two variables into one.
I did the following:
in my env variables i had set
PATH_DESTINATION_1=/root/path_one
PATH_DESTINATION_2=/root/path_two
#!/usr/bin/ksh
count=1
count_path=2
while
do (3 Replies)
I've been trying to find information in regard to creating a script that will generate HTML files. I currently have a series of files that contain code I need to surround with a <textarea> tag for easy viewing. I have about a thousand files that contain code, one file that contains the HTML code up... (10 Replies)
I have 2 files.
each having 3 coloums
1st field date as 20130322
2nd field time as 05:55
3rd field numberic value
File 2 has entries missing for some date time.
FILE1
20130322 05:35 2219
20130322 05:40 1809
20130322 05:45 1617
20130322 05:50 ... (2 Replies)
Hello Everyone,
I have 4 different files (one column in each) that I'm trying to combine into 1 file with four columns. Having issues trying to get the columns to format properly. I have tried the following:
paste file1 file2 file3 file4 | column -s $'\t' -t > results.txt
paste file1 file2... (1 Reply)
Hi folks!
Kind of a noob question... from an OLD AIX/HPUX Admin.
I am writing a script to ease use of a command; an extended aliasing if you will. What I want to do is set several variables (OPT1, OPT2, etc) with command arguments, such as --help, --list-all, etc. Later in the script, I... (5 Replies)
I'm trying to learn about regular expressions. Let's say I want to list all the files in /usr/bin beginning with "p", ending with "x", and containing an "a".
I know this works:ls | grep ^p | grep x$ | grep abut I'm thinking there must be a way to do it without typing grep three times. Some of my... (9 Replies)
Here is the whole script, very simple, but I am just learning
ROK_NO=$1
RPT=/tmp/test
sed -E '/^SELECT/ s/(.{23}).{8}/\1'"$ROK_NO"' /' $RPT
echo $RPT
When I run this I get
$ bash rok.sh 2388085
: No such file or directory
/tmp/test
When I type the command in console, it works... (3 Replies)