9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I need to write a BASH script that takes a 2 character string and removes the second character if it is not a digit e.g.
If the string is numberical value >9 e.g. string1 = '34' then leave string1 = '34'.
However if the string is <10 e.g. string1 = '3X' then remove the second char (which... (7 Replies)
Discussion started by: millsy5
2. Shell Programming and Scripting
how can i cont number of char with loop coomand?
i dont want to use wc or other special command
the script should check all word's char. one by one
also a counter can handle the number
As noted in other threads started today. This is not the correct forum for homework assignments. ... (2 Replies)
Discussion started by: nimafire
I am using ifstream to open a file using
void open ( const char * filename, ios_base::openmode mode = ios_base::in );
However I want to use a string instead of a char* as follows but having a problem on how to do this
string val_ifmodl = “fred.modl”
ifstream ifs_modl;... (2 Replies)
Discussion started by: kristinu
Hi guys, I am stuck up in a situation. I have a SUN box with certain logs which I need to parse to draw a report using Perl.
Now, when I load the text file using a perl degugger to see how the text looks like when the first line of the log file is read in a variable. below is the snapshot of... (2 Replies)
Discussion started by: Asteroid
5. Shell Programming and Scripting
To find out number of "|" symbol is available in file:
I am using below set of commands,It is working... Anybody have anyother solution using sed / awk.
cnt=`wc -c <1.txt`
cnt1=`tr -d "|" <1.txt >c.dat`
cnt2=`wc -c <c.dat`
outp=`expr $cnt... (19 Replies)
Discussion started by: Jairaj
6. Shell Programming and Scripting
I am stumped! I need to parse an input parameter to a script that has the form '-Ort'. I basically need 'O', 'r' and 't', i.e. the individual characters in the string parsed.
Since there are no delimiters, I don't know how awk could do this. Can someone tell how to do this, this should be a... (5 Replies)
Discussion started by: ALTRUNVRSOFLN
7. Shell Programming and Scripting
i have a script that reads a plain text file. (its a ksh, and i can use bash also)
each line of the file is a fullpath of a file. that makes the list huge.
i need to add a functionalitie to that script, i have to be able to add
/usr/* or /usr/ and with that reference all the files and folders... (6 Replies)
Discussion started by: broli
This is actually a c++ question...
Basically I am creating a program that asks for five characters. I have a dictionary file containing tons of words no long than five letters long, on a seperate line. I want to be able to take the five inputted letters and compare them to the words in the file... (3 Replies)
Discussion started by: Phobos
9. Shell Programming and Scripting
I wish to compute the number of dot chars in a string.
I try the shortest command to solve this test.
Thanks in advance for your help.
Giovanni (7 Replies)
Discussion started by: gio123bg