10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies
2. Shell Programming and Scripting
I am reasonably capable with awk and its quirks, but not with shell weirdness. This has to be Bourne Shell for portability reasons. I have an awk program that is working just fine; it handles multiple input streams and produces several reports, based on the request (-v Variables). In addition... (3 Replies)
Discussion started by: DerekAsirvadem
3 Replies
3. Shell Programming and Scripting
Hi, everyone!
I have a file, when I print its $1 out it show several strings like this:
AABBCC
AEFJKLFG
FALEF
FAIWEHF
What I want to do is that, after output of each record, search the string in all files in the same folder, print out the record and file name.
This is what I want... (4 Replies)
Discussion started by: xshang
4 Replies
4. Shell Programming and Scripting
I have 3 files and each contain m*n matrix.
m = number of rows (horizontal lines)
n = number of columns (entries in a particular line)
What I wish to find is the sum of the 2nd number in the last row.
Ex
file1.dat
2 5 8 8
4 6 7 8
3 8 3 7
file2.dat
3 4 1 4
8 4 0 3
4 7 3 7
... (3 Replies)
Discussion started by: dynamics
3 Replies
5. Shell Programming and Scripting
Hi experts,
Sorry if it sounds basic question. I am trying to delete all folders except a particular and I have written the following. But its not deleting the folder.
Could you tell me whats wrong?
folders are:
1 2 3 4 5 6
ls -l | awk '{ if ($9 != 4) {system(/bin/rmdir $9);print... (5 Replies)
Discussion started by: amitrajvarma
5 Replies
6. Shell Programming and Scripting
File1
9000|9000|WW|1|1|SL|472|472|LC|2272|1072|MTY
9000|9000|WW|1|1|SL|470|470|MC|1270|1172|MPVT
9000|9000|WW|1|1|SL|472|472|LC|1072|1672|MBD
9000|9000|WW|1|1|SL|473|473|LF|1173|1173|MTY
File2
DPT.1072 CP~ Apr 1514283.914 (12 Replies)
Discussion started by: yale_work
12 Replies
7. Shell Programming and Scripting
I have a bash shell script that sources a data file, the data file has array values such as:
#--data file ---#
sg_name="db1"
sg_size="12892"
sg_allow="50000"
sg_name="db2"
sg_size="12892"
sg_allow="50000"
export sg_name sg_size sg_allow
#--end data file --#
In my shell script... (8 Replies)
Discussion started by: lochraven
8 Replies
8. UNIX for Advanced & Expert Users
I've a list file, which has some file names.
ex: list file "list_file" will have
data_file1.txt
data_file2.txt
data_file3.txt
:
:
data_filen.txt
Above files will have the below layout:
Header1
Header2
*TM*
Data record 1
Datarecord 2
Datarecord n
*TM* (19 Replies)
Discussion started by: Lokesha
19 Replies
9. Shell Programming and Scripting
Oh its not my day for syntax...
cat gzipsize.txt | awk '{print "echo",$1,$2} > master.txt
I have read a lot about the awk -v but haven't been able to get it to work. I have a variable in my script and I'm looking just to push it into the awk after the $2 (or anywhere would do)!!!
Every... (11 Replies)
Discussion started by: nortypig
11 Replies
10. UNIX for Advanced & Expert Users
Hi all,
I have a ascii text file like this :
$cat a.txt
abc |12343 |xyakdfj |
x |323 ||
kr1 |13434343|234343 |
Is it possible to to get the file eleminating blank spaces?
output file :
abc|12343|xyakdfj|
x|323||... (7 Replies)
Discussion started by: krishna
7 Replies