02-16-2019
Welcome to the forum.
If you post a question, it's best to also mention the OS, shell, and tools' versions that you use, so a solution can be taylored to your situation. For instance, several seds out there have features that allow for a concise solution that others don't.
- Do you have awk at hand? Could be used to do all of it in one go.
- Did you consider the split command? Looks like it is made for your problem, even to produce the desired file names.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi, first congratulations on the nice forum!
Can anybody write script, which can make copy of some or all files of the current directory in new directory (called "backups", which must be made in the current directory, if it's not already exist). And bring out a massage (report) with the count... (7 Replies)
Discussion started by: Cecko
7 Replies
2. Shell Programming and Scripting
Hi,
root@server] df -h
121G 14G 101G 12% /home
147G 126G 14G 91% /backup
We having our site files and images are storing in
/backup/home/user/files/ through symbolic link created in /home directory pointing in /backup directory as following.
root@server] cd /home... (1 Reply)
Discussion started by: mirfan
1 Replies
3. Homework & Coursework Questions
I am very new to Linux/Unix. Kindly assist the following:
I wish to write a bash shell script called how_many_to_go that calculates and prints the number of days, hours, minutes and/or seconds until the end of the current month (based on the output of the date command).
Do ... (2 Replies)
Discussion started by: alobi
2 Replies
4. Shell Programming and Scripting
I am newbie to UNIX. I came across this exercise in one the books.Can anyone help me with this question??????
Write a short Bash script that, given the name of a file as an argument,
reads the file name and creates a new file containing only lines which consist
of one word. Here is an example... (4 Replies)
Discussion started by: krthknaidu
4 Replies
5. Shell Programming and Scripting
Hi all,
This is my sample code in /etc/httpd/conf.d/applications.conf file currently we are creating subdomain mannually for every new subdomain. I want to automate this process througs bash script , how its possible.
<VirtualHost *:80>
ServerName google.com
ServerAlias google.com... (5 Replies)
Discussion started by: anishkumarv
5 Replies
6. Shell Programming and Scripting
Hi All,
I am unable to write the script for the below requirement.
Requirement:
Main table dir_ancillary table contain three column "dir_ancillary.table_name"," dir_ancillary.text_file_name ", "dir_ancillary.Include" .
This dir_ancillary contain undefined tables in the column... (2 Replies)
Discussion started by: Vineeta Nigam
2 Replies
7. Shell Programming and Scripting
Hi Team
I am trying to put together a nice small script to mount my lvm snapshot
Here are my objectives
1 Check whether snapshot is currently mounted. If so echo umount snapshot and exit from the script.
2 If it's not mounting, check whether the mount point exist, If so, create lvm... (0 Replies)
Discussion started by: fugeulu
0 Replies
8. Shell Programming and Scripting
Hello everyone.
I'm a Linux novice trying out a lot of bash scripting lately, as it is so very addictive.
Lately I have been setting up one of my boxes remotely and have been hardening it as much as possible. Please allow me to explain the scenario, as it does tend to become a little... (1 Reply)
Discussion started by: instro
1 Replies
9. UNIX for Beginners Questions & Answers
#!/bin/bash -i
SAVEIFS=$IFS
IFS=$"\n\b"
picc=$*
if ; then
echo $TDATE
if ; then
touch dummy
touch -t "tdate" dummy
touch -r "dummy" "$picc"
else
echo -e "No mod date value to apply. If there is one in your shell,\ninvoke \eStarted asking advice on this (on Linuxquestions.org).... (9 Replies)
Discussion started by: iamwrong
9 Replies
10. UNIX for Beginners Questions & Answers
How would I write a value to a physical memory address?
I was able to read a physical memory address (for example, 0x400) using this line:
dd if=/dev/mem count=4 bs=1 skip=$(( 0x400 ))
But I get an error:
dd: 'standard input': cannot skip to specified offset
when I try to write using... (1 Reply)
Discussion started by: rabrandt
1 Replies
LEARN ABOUT DEBIAN
sgels.f
sgels.f(3) LAPACK sgels.f(3)
NAME
sgels.f -
SYNOPSIS
Functions/Subroutines
subroutine sgels (TRANS, M, N, NRHS, A, LDA, B, LDB, WORK, LWORK, INFO)
SGELS solves overdetermined or underdetermined systems for GE matrices
Function/Subroutine Documentation
subroutine sgels (characterTRANS, integerM, integerN, integerNRHS, real, dimension( lda, * )A, integerLDA, real, dimension( ldb, * )B,
integerLDB, real, dimension( * )WORK, integerLWORK, integerINFO)
SGELS solves overdetermined or underdetermined systems for GE matrices
Purpose:
SGELS solves overdetermined or underdetermined real linear systems
involving an M-by-N matrix A, or its transpose, using a QR or LQ
factorization of A. It is assumed that A has full rank.
The following options are provided:
1. If TRANS = 'N' and m >= n: find the least squares solution of
an overdetermined system, i.e., solve the least squares problem
minimize || B - A*X ||.
2. If TRANS = 'N' and m < n: find the minimum norm solution of
an underdetermined system A * X = B.
3. If TRANS = 'T' and m >= n: find the minimum norm solution of
an undetermined system A**T * X = B.
4. If TRANS = 'T' and m < n: find the least squares solution of
an overdetermined system, i.e., solve the least squares problem
minimize || B - A**T * X ||.
Several right hand side vectors b and solution vectors x can be
handled in a single call; they are stored as the columns of the
M-by-NRHS right hand side matrix B and the N-by-NRHS solution
matrix X.
Parameters:
TRANS
TRANS is CHARACTER*1
= 'N': the linear system involves A;
= 'T': the linear system involves A**T.
M
M is INTEGER
The number of rows of the matrix A. M >= 0.
N
N is INTEGER
The number of columns of the matrix A. N >= 0.
NRHS
NRHS is INTEGER
The number of right hand sides, i.e., the number of
columns of the matrices B and X. NRHS >=0.
A
A is REAL array, dimension (LDA,N)
On entry, the M-by-N matrix A.
On exit,
if M >= N, A is overwritten by details of its QR
factorization as returned by SGEQRF;
if M < N, A is overwritten by details of its LQ
factorization as returned by SGELQF.
LDA
LDA is INTEGER
The leading dimension of the array A. LDA >= max(1,M).
B
B is REAL array, dimension (LDB,NRHS)
On entry, the matrix B of right hand side vectors, stored
columnwise; B is M-by-NRHS if TRANS = 'N', or N-by-NRHS
if TRANS = 'T'.
On exit, if INFO = 0, B is overwritten by the solution
vectors, stored columnwise:
if TRANS = 'N' and m >= n, rows 1 to n of B contain the least
squares solution vectors; the residual sum of squares for the
solution in each column is given by the sum of squares of
elements N+1 to M in that column;
if TRANS = 'N' and m < n, rows 1 to N of B contain the
minimum norm solution vectors;
if TRANS = 'T' and m >= n, rows 1 to M of B contain the
minimum norm solution vectors;
if TRANS = 'T' and m < n, rows 1 to M of B contain the
least squares solution vectors; the residual sum of squares
for the solution in each column is given by the sum of
squares of elements M+1 to N in that column.
LDB
LDB is INTEGER
The leading dimension of the array B. LDB >= MAX(1,M,N).
WORK
WORK is REAL array, dimension (MAX(1,LWORK))
On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK
LWORK is INTEGER
The dimension of the array WORK.
LWORK >= max( 1, MN + max( MN, NRHS ) ).
For optimal performance,
LWORK >= max( 1, MN + max( MN, NRHS )*NB ).
where MN = min(M,N) and NB is the optimum block size.
If LWORK = -1, then a workspace query is assumed; the routine
only calculates the optimal size of the WORK array, returns
this value as the first entry of the WORK array, and no error
message related to LWORK is issued by XERBLA.
INFO
INFO is INTEGER
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
> 0: if INFO = i, the i-th diagonal element of the
triangular factor of A is zero, so that A does not have
full rank; the least squares solution could not be
computed.
Author:
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date:
November 2011
Definition at line 183 of file sgels.f.
Author
Generated automatically by Doxygen for LAPACK from the source code.
Version 3.4.1 Sun May 26 2013 sgels.f(3)