Sponsored Content
Top Forums Shell Programming and Scripting Extracting characters and storing in some variable Post 302719157 by umesh314 on Monday 22nd of October 2012 07:36:38 AM
Old 10-22-2012
Extracting characters and storing in some variable

eg:
./myProgram.sh filename.cpp

I want to remove the :".cpp" extension from the filename.cpp

expected output: filename
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Storing values in variable

Hi All, Here is the description of the problem. I am scripting for database access using k-shell on solaris box dbaccess <databasename> - << EOF 2>/dev/null | awk 'BEGIN {FS=" "}\ {printf "%s", $1}' | grep -v "^$" | \ read cnt1 OUTPUT TO PIPE cat WITHOUT HEADINGS select count(*) from... (1 Reply)
Discussion started by: matrixmadhan
1 Replies

2. UNIX for Dummies Questions & Answers

Storing the output into a variable

Hi unix gurus, I am trying to store the result of a command into a variable. But it is not getting stored. x='hello' y=echo $x | wc -c but it is giving the output as 0(zero) Pls help me its very urgent (7 Replies)
Discussion started by: ravi raj kumar
7 Replies

3. Shell Programming and Scripting

Storing a variable?

I'm writing a bash shell script to backup several mysql databases. This script will run on a daily basis and send a copy to a remote FTP repository. The filenames are in the format DATE.backup.sql. How do I store the DATE variable so I can delete/move/etc the file on the FTP server the next time... (4 Replies)
Discussion started by: hoover90
4 Replies

4. Shell Programming and Scripting

Storing value in a variable

Hi Everyone, I have a code which requires to be stored in different variables and I am achiving it like this. HOST=`echo $RMP | cut -f2 -d:` NAME=`echo $RMP | cut -f3 -d:` DIR=`echo $RMP | cut -f4 -d:` TYPE=`echo $RMP | cut -f5 -d:` Is there any other way of storing value... (2 Replies)
Discussion started by: gehlnar
2 Replies

5. Shell Programming and Scripting

About storing the value of wc -l into a variable and then using this value in while

Hi all, I m new to this forum. I ma facing onei issue. I have something like this: length= wc -l < b2| awk '{print $1}' where b2 is filename having detauls like: cat b2 abc1 abc4 xyc3 sbdghf4 but when I do echo "$length" it displays nothing Also I am using awk to overcome... (4 Replies)
Discussion started by: student2009
4 Replies

6. UNIX Desktop Questions & Answers

Extracting data from tables and storing in a file

Hi I am trying to write a script to extract information from a database and save that info to a csv file. I am using sql, an oracle database I have no idea how to even begin this. Can somebody please help. (8 Replies)
Discussion started by: ladyAnne
8 Replies

7. Shell Programming and Scripting

Storing a field within a variable

Hi, I need to figure out a way to to capture the contents of a field that is separated by a pipe sign. Example Data: -100F| some other description -10C| some description | some description As you can see, the length of the field on the left of the pipe can be any length and... (3 Replies)
Discussion started by: doza22
3 Replies

8. Shell Programming and Scripting

Extracting columns from a matrix and storing each column in a separate file

Hi All, I have a huge matrix file consisting some some millions rows and 6000 columns. The contents are just floating point numbers in the matrix. I want to extract each column (i.e. 6000 of them) and store each column in a separate file. For example, 1.dat will consist of elements from column... (4 Replies)
Discussion started by: shoaibjameel123
4 Replies

9. Shell Programming and Scripting

Storing a variable using sed

I would like to use sed to store a variable. The code is : echo $HEADERREC CUTVAR=$(echo "$HEADERREC"|sed 's/SDV/STR') echo $CUTVAR Output I am getting now: 0012PVGRSCDVSDV 005 00000000000000000000 2014 0.00 sed: Function s/SDV/STR cannot be parsed. Desired... (5 Replies)
Discussion started by: MIA651
5 Replies

10. UNIX for Advanced & Expert Users

Passing variable as input & storing output in other variable

I have a below syntax its working fine... var12=$(ps -ef | grep apache | awk '{print $2,$4}') Im getting expected output as below: printf "%b\n" "${VAR12}" dell 123 dell 456 dell 457 Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
zipios::ZipOutputStream(3)				     Library Functions Manual					zipios::ZipOutputStream(3)

NAME
zipios::ZipOutputStream - SYNOPSIS
#include <zipoutputstream.h> Public Member Functions ZipOutputStream (std::ostream &os) ZipOutputStream constructor. ZipOutputStream (const std::string &filename) ZipOutputStream constructor. void closeEntry () Closes the current entry updates its header with the relevant size information and positions the stream write pointer for the next entry header. void close () Calls finish and if the ZipOutputStream was created with a filename as a parameter that file is closed as well. void finish () Closes the current entry (if one is open), then writes the Zip Central Directory Structure closing the ZipOutputStream. void putNextEntry (const ZipCDirEntry &entry) void putNextEntry (const std::string &entryName) void setComment (const std::string &comment) Sets the global comment for the Zip archive. void setLevel (int level) Sets the compression level to be used for subsequent entries. void setMethod (StorageMethod method) Sets the compression method to be used. virtual ~ZipOutputStream () Destructor. Detailed Description ZipOutputStream is an ostream that writes the output to a zip file. The interface approximates the interface of the Java ZipOutputStream. Definition at line 18 of file zipoutputstream.h. Constructor &; Destructor Documentation zipios::ZipOutputStream::ZipOutputStream (std::ostream &os) [explicit] ZipOutputStream constructor. Parameters: os ostream to which the compressed zip archive is written. pos position to reposition the ostream to before reading. Definition at line 13 of file zipoutputstream.cpp. zipios::ZipOutputStream::ZipOutputStream (const std::string &filename) [explicit] ZipOutputStream constructor. filename to write the zip archive to. Definition at line 24 of file zipoutputstream.cpp. zipios::ZipOutputStream::~ZipOutputStream () [virtual] Destructor. Definition at line 74 of file zipoutputstream.cpp. Member Function Documentation void zipios::ZipOutputStream::close () Calls finish and if the ZipOutputStream was created with a filename as a parameter that file is closed as well. If the ZipOutputStream was created with an ostream as its first parameter nothing but the call to finish happens. Definition at line 38 of file zipoutputstream.cpp. void zipios::ZipOutputStream::closeEntry () Closes the current entry updates its header with the relevant size information and positions the stream write pointer for the next entry header. Puts the stream in EOF state. Call putNextEntry() to clear the EOF stream state flag. Definition at line 33 of file zipoutputstream.cpp. void zipios::ZipOutputStream::finish () Closes the current entry (if one is open), then writes the Zip Central Directory Structure closing the ZipOutputStream. The output stream that the zip archive is being written to is not closed. Definition at line 45 of file zipoutputstream.cpp. void zipios::ZipOutputStream::putNextEntry (const ZipCDirEntry &entry) Begins writing the next entry. Definition at line 50 of file zipoutputstream.cpp. void zipios::ZipOutputStream::putNextEntry (const std::string &entryName) Begins writing the next entry. Definition at line 54 of file zipoutputstream.cpp. void zipios::ZipOutputStream::setComment (const std::string &comment) Sets the global comment for the Zip archive. Definition at line 59 of file zipoutputstream.cpp. void zipios::ZipOutputStream::setLevel (intlevel) Sets the compression level to be used for subsequent entries. Definition at line 64 of file zipoutputstream.cpp. void zipios::ZipOutputStream::setMethod (StorageMethodmethod) Sets the compression method to be used. only STORED and DEFLATED are supported. Definition at line 69 of file zipoutputstream.cpp. Author Generated automatically by Doxygen for Zipios++ from the source code. Zipios++ Mon Oct 10 2011 zipios::ZipOutputStream(3)
All times are GMT -4. The time now is 10:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy