10 More Discussions You Might Find Interesting
1. Programming
I have a String class with a function that reads tokens using a delimiter.
For example
String sss = "6:8:12:16";
nfb = sss.nfields_b (':');
String tkb1 = sss.get_token_b (':');
String tkb2 = sss.get_token_b (':');
String tkb3 = sss.get_token_b (':');
String tkb4 =... (1 Reply)
Discussion started by: kristinu
1 Replies
2. Shell Programming and Scripting
Hi guys,
I'm wondering what the best way would be to reverse words in a string based on certain characters.
For example:
echo Word1Word2Word3Word4 | sed '
/\n/ !G
s/\(Word.\)\(.*\n\)/&\2\1/
//D
'
This returns:
Word4Word3Word2Word1
I'm no sed expert but... (2 Replies)
Discussion started by: Subbeh
2 Replies
3. Shell Programming and Scripting
I have a file which is
DFDG
START
DSFDS
DSDS
XXX
END (VIO)
AADD
START
SDSD
FGFG
END
and I have to print the lines between START and END (VIO). In the files there are multiple places where START would be followed by END with few lines in between but I need to print only if START is... (18 Replies)
Discussion started by: pgbuddy
18 Replies
4. Shell Programming and Scripting
Hi All,
Im writing a shell script in which I want to get the folder names in one folder to be used in for loop.
I have used:
packsName=$(cd ~/packs/Acquisitions; ls -l| awk '{print $9}')
echo $packsName
o/p: opt temp user1 user2
ie. Im getting the output as a string.
But I want... (3 Replies)
Discussion started by: AB10
3 Replies
5. Shell Programming and Scripting
Hey everyone, i needed some help with this one. We move into a new file system (which should be the same as the previous one, other than the name directory has changed) and the script worked fine in the old file system and not the new. I'm trying to add the results from one with another but i'm... (4 Replies)
Discussion started by: senormarquez
4 Replies
6. Shell Programming and Scripting
Hi all,
I have a variable with value
DateFileFormat=NAME.CODE.CON.01.#.S001.V1.D$.hent.txt
I want this variable to get replaced with :
var2 is a variable with string value
DateFileFormat=NAME\\.CODE\\.CON\\.01\\.var2\\.S001\\.V1\\.D+\\.hent\\.txt\\.xml$
Please Help (3 Replies)
Discussion started by: abhinav192
3 Replies
7. Shell Programming and Scripting
i store the output of ls in a variable FL
$FL=`ls`
$echo $FL
f1.txt f2.txt f3.txt f4.txt f5.txt script.sh script.sh~ test.txt
now if i want to retrive the sub-string "f1.txt" from $FL we were taught that this is what i have to do
$set $FL
$echo $1
f1.txt
and echo $2 would give... (1 Reply)
Discussion started by: c_d
1 Replies
8. Shell Programming and Scripting
Hello-
Trying to add two numbers in a ksh shell scripts and i get this error every time I execute
stat1_ex.ksh: + : more tokens expected
stat1=`cat .stat1a.tmp | cut -f2 -d" "`
stat2=`cat .stat2a.tmp | cut -f2 -d" "`
j=$(($stat1 + $stat2)) # < Here a the like the errors out
echo $j... (3 Replies)
Discussion started by: Nomaad
3 Replies
9. UNIX for Dummies Questions & Answers
im trying to remove all occurences of " OF xyz " in a file where xyz could be any word assuming xyz is the last word on the line but I won't always be.
at the moment I have sed 's/OF.*//'
but I want a nicer solution which could be in pseudo code
sed 's/OF.* (next token)//'
Is... (6 Replies)
Discussion started by: seaten
6 Replies
10. UNIX for Dummies Questions & Answers
so i have been trying to learn how to manipulate text on my own and have gotten stumped...
let's say i have a text file that says (highly simplified):
people ordinary
How would swap the order of the words..
I know i need to use sed and some kind of back reference but cannot make it... (2 Replies)
Discussion started by: urtherhoda
2 Replies