10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I am using following script to name the file base of some values
#!/bin/sh
sourcefile=$1
awk '
BEGIN{ n = 1; name = "FILEFILE12" n ".txt"; }
{
if (substr($0,1,10) == "FILEFILE12")
{
close (name)
n++
a = substr($0,11,10);
b = substr($0,21,5);
name = b "_Src_" a ".txt"
}... (6 Replies)
Discussion started by: manish8484
6 Replies
2. Shell Programming and Scripting
I have a file which contains certain records about users. the row length is always fixed to 205 characters.
Now I want to read each record line from the file, substring some portion out of it and put into another file. But I have observed that my script is trimming the extra spaces I have used for... (4 Replies)
Discussion started by: Pramit
4 Replies
3. Shell Programming and Scripting
Hello all. I am a newb obviously and a bit stumped on this, so any help gratefully accepted.
The script is extracting metadata from individual mp3 files, then (hopefully will be) sorting them into newly-created subdirectories. I have filtered out the relevant metadata and have the album names... (8 Replies)
Discussion started by: spoovy
8 Replies
4. Shell Programming and Scripting
friends,
I have a script in solaris 10 SPARC system which is like this
date '+Time: %m/%d/%y %H:%M:%S'
echo " GDBRR GDLRR GDBWR GDLWR GDRRR GDRWR "
sar -b 10 10 |/usr/xpg4/bin/awk '!/Average/ && !/SunOS/ && !/bread/ {$1="";T=$2;T1=$3;T2=$5;T3=$6;T4=$8;T5=$9}{print(T"\t",... (1 Reply)
Discussion started by: achak01
1 Replies
5. Shell Programming and Scripting
I'm using this thread as an example, but can't seem to apply it to my situation.
I'm trying to strip the trailing slash (/) from an input argument. Here's a snippet of my command line input and the troublesome code:
$ script_name -s "../pathname/dir/"
snip 8< ...
while getopts :s:... (5 Replies)
Discussion started by: ricksj
5 Replies
6. UNIX for Advanced & Expert Users
Hi,
How can I remove the unwanted spaces in the line.
123456 789 ABC DEF. - I wanna remove the sapces in this line, I need the output 123456789ABCDEF.
Pls help me...... (3 Replies)
Discussion started by: sharif
3 Replies
7. Shell Programming and Scripting
I have a variable that calls in a string from txt file. Problem is the string comes with an abundance of white spaces trailing it. Is there any easy way to trim the tailing white spaces off at the end? Thanks in advance. (9 Replies)
Discussion started by: briskbaby
9 Replies
8. Solaris
Hi my lovely friends,
Im writing one pgm in which i trying to assign some values like
$var='Jun 6'
but if i do echo of this $var will trim the spaces expect one space.
$echo $var
$Jun 6
But if var='Jun 28', then this will works fine
$echo $var
$Jun 28
this is required to exctract... (2 Replies)
Discussion started by: Lokesha
2 Replies
9. Shell Programming and Scripting
Hi,
my var is:
PATH_LOG=/opt/WebSphere/CR Comune Roma.log
a filename which contains blank chars.
How can I call it from prompt ?
Ex:
ls $PATH_LOG or
cat $PATH_LOG
tks,
Carmen- (2 Replies)
Discussion started by: Carmen123
2 Replies
10. Shell Programming and Scripting
I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help.
echo $SH_VAR | command_line Syntax.
The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Discussion started by: jerardfjay
6 Replies