Say I write something like the following:
var1=1
var2=2
for int in 1 2
do
echo "\$var$int"
done
I want the output to be:
1
2
Instead I get something like:
$var1
$var2 (2 Replies)
I am passing a file name as a parameter to shell script
the parameter is getfile.txt.gpg
how do i process this parameter to get name like getfile.txt only and eleminate the .gpg text??
Thanks in advance (2 Replies)
Hi,
I will pass 3 parameters for a script.I have to check the file name and create a new file name with time stamp.
the parameters which i'm passing are
/dir/stg/filename.txt
/dir/path/head.txt
/dir/path/tail.txt
Now i have to check filename like :
if it is a.txt i have to create... (2 Replies)
Hi,
I am executing a shell script which takes a string as a parameter.
The scipt should validate the string and create the directoy with the name of specfied string.
The following is the specified command and its parameter.
test.sh "abc abc"
The shell script is not able to identify... (4 Replies)
i got a file called Pass1, and then i need to passed a number to my script with the '-p pass_mark' option.
Example type
Pass1 -p 18
to pass 18 to my script for comparing things, so how can i do it? (7 Replies)
I have written a function that fills an array and another function where if a parameter is supplied it will jump to that part of the array and cat it to the screen.
I need to put in some checks to make sure the parameter supplied is firstly a number and then not a number great than the length of... (2 Replies)
Hello Everyone,
I have been trying to complete a shell script where, I need to increment the date depending on the file (depending on the date) availability on the remote server.
i.e.
Basically, I will be passing a counter (like parameter 1 or 2 or 3 or 4).
First I will check for the... (1 Reply)
Hi
I am looking for a unix command or a small shell script which can takes one parameter and then searches for the passed in the parameter in any or all files under say /home/dev/
Can anyone please help me on this? (3 Replies)
i am passing input parameter 'one_two' to the script , the script output should display the result as below
one_1two
one_2two
one_3two
if
then
echo " Usage : <$0> <DATABASE> "
exit 0
else
for DB in 1 2 3
do
DBname=`$DATABASE | awk -F "_" '{print $1_${DB}_$2}`
done
fi (5 Replies)
Discussion started by: only4satish
5 Replies
LEARN ABOUT OPENSOLARIS
fspec
fspec(4) File Formats fspec(4)NAME
fspec - format specification in text files
DESCRIPTION
It is sometimes convenient to maintain text files on the system with non-standard tabs, (tabs that are not set at every eighth column).
Such files must generally be converted to a standard format, frequently by replacing all tabs with the appropriate number of spaces, before
they can be processed by system commands. A format specification occurring in the first line of a text file specifies how tabs are to be
expanded in the remainder of the file.
A format specification consists of a sequence of parameters separated by blanks and surrounded by the brackets <: and :>. Each parameter
consists of a keyletter, possibly followed immediately by a value. The following parameters are recognized:
ttabs The t parameter specifies the tab settings for the file. The value of tabs must be one of the following:
o A list of column numbers separated by commas, indicating tabs set at the specified columns.
o A '-' followed immediately by an integer n, indicating tabs at intervals of n columns.
o A '-' followed by the name of a ``canned'' tab specification.
Standard tabs are specified by t-8, or equivalently, t1,9,17,25, etc. The canned tabs that are recognized are defined by the
tabs(1) command.
ssize The s parameter specifies a maximum line size. The value of size must be an integer. Size checking is performed after tabs have
been expanded, but before the margin is prepended.
mmargin The m parameter specifies a number of spaces to be prepended to each line. The value of margin must be an integer.
d The d parameter takes no value. Its presence indicates that the line containing the format specification is to be deleted from
the converted file.
e The e parameter takes no value. Its presence indicates that the current format is to prevail only until another format specifi-
cation is encountered in the file.
Default values, which are assumed for parameters not supplied, are t-8 and m0. If the s parameter is not specified, no size checking is
performed. If the first line of a file does not contain a format specification, the above defaults are assumed for the entire file. The
following is an example of a line containing a format specification:
* <:t5,10,15 s72:> *
If a format specification can be disguised as a comment, it is not necessary to code the d parameter.
SEE ALSO ed(1), newform(1), tabs(1)SunOS 5.11 3 Jul 1990 fspec(4)