General :: How To Append A Char Or Strong

Aug 24, 2010

the query is ||| how to append a char | string |||

#!/bin/bash
echo -n "one""two""three"
#END

above method is working well but below method is not working ?

#!/bin/bash
one=one
two=two
three=three
echo -n $one$two$three
#END

View 5 Replies


ADVERTISEMENT

Programming :: Fixing C++ Invalid Conversion From Const Char* To Char?

Mar 4, 2010

m getting the following error when trying to compile:Quote:

$ make
g++ -march=athlon64 -O2 -pipe -fomit-frame-pointer -msse3 -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"undelete"' -DHAVE_SVDRP -I../../../include undelete.c

[code]...

View 14 Replies View Related

Programming :: Point A Char Pointer To A Part Of Another Char Array?

Nov 4, 2010

Programming in C.I have two char arrays.char buf1[1024];char buf2[1024];Aren't buf1 and buf2 also pointers?I read in 1024 bytes into buf1 which contain about 300 bytes of characters with newlines. The data is basically a few English sentences. I'm trying to scan buf1 for newlines and then stop at the 1st newline and copy the rest of the data from that 1st newline into buf2.So I run a for loop to look for that new line.

Code:
for(i=0; i<1024;i++) {
if((strcmp(&buf1[i], "

[code]...

View 8 Replies View Related

Programming :: C++ Invalid Conversion From Const Char* To Char*

Jul 9, 2010

I am having trouble with the following exception class.

Code:

/**Standard Exception
*
*@description
*@update
*@changes

[code]....

Line 43 points at the snprintf() command.I think the error has to do with the function being virtual and the const after the function definition, however although I have been looking really hard I have not being able to find the reason nor the solution to the problem.

One workaround that I know is moving the block of source withing the virtual function, in the constructor, however having read around (boost library exceptions tutorials) it specifically said that formating of errors messages should not take place withing the construction of objects because we are risking throwing an exceptions and messing up the flow order.

View 11 Replies View Related

Programming :: Char Variable Is Behaving As Unsigned Char?

Feb 14, 2011

i define variable of type char (range -128 to 127). when i tried to print the value after assigning a -ve value to it it displaying a +ve value of that -ve value(256+value).

View 3 Replies View Related

Programming :: SH: Remove Last Char If It Is An Empty Char In A String

Jul 5, 2011

With this I may remove the last emtpy char which is not visible, coming from net, windows, ...

Code:
echo "$mystringwindowsorotherwithemptylastchar" |sed s/.$//

However if there are not then it makes a problem and delete effectively an existing char.

Code:
echo "klklj" |sed s/.$//
klkl

Anyone would have a solution for SH?

View 2 Replies View Related

Programming :: Convert A Char * To Unsigned Char?

Mar 4, 2010

is it possible to convert a variable from char * to unsigned char ?

View 5 Replies View Related

General :: Secure Box - Authentication Failure - Long Strong Password Can Stop To Prevent From Attacks?

Mar 17, 2010

we are using linux email server axigen past few years. we keep port open ssh and pop,smtp webmail etc. ssh use for remote trouble shooting. so through firewall it is globally accessable. we notice many attacks coming to our machine, also some people try to enter in our system but failure. as example see below a log come in messages file

Mar 17 09:19:50 sa1 sshd(pam_unix)[21231]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=210.51.13.120 user=root how we can secure more. as per my understanding only good long strong password can stop to prevent from attacks.

View 5 Replies View Related

Programming :: Programing - Reading File Line By Line Then Char By Char In Each Line

May 29, 2010

I've never programed shell scripting.

Code goes like so:

I simply want to read a file "data.txt" line by line Then char by char and add them into a result var. The file is supossed to always contain numeric values

View 8 Replies View Related

General :: Append File Name

Oct 7, 2009

I know similar questions have been asked before but I cannot seem to get it to work.I have a file file.something.nhMMYY that i need to ftp (MMYY being Month and Year)I want to add something into the script to auto-magically insert the MMYY.

View 8 Replies View Related

General :: Append Text With AWK Or SED?

Mar 19, 2010

I'm doing an assignment for school, and while we have not yet learned regular expressions, my teacher would like us to use AWK to append text to certain lines in a file. What we've had to do is creating a listing of all links and directories in the /etc folder and place them in a text file. From this, we were to cut the first field (Permissions) and the ninth field (filename) and create another text file. Now the part that I'm struggling with is this and I'm not sure if I should be using sed or awk. We're supposed to ADD the text "DIR" to the beginning of any line that is a directory, and "LNK" to any that is a link, like so:

DIRdrwxr-xr-x redhat-lsb
DIRdrwxr-xr-x rhgb
LNKlrwxrwxrwx rnDIRc.key
DIRdrwxr-xr-x rpm

Obviously, I realize that the first character in the permissions denotes what sort of file it is, hence when I created my text file I used

ls -l | grep "^d" > file.txt
and
ls -l | grep "^l" >> file.txt

I'd like to learn how to properly do this, but struggling through pages on the internet hasn't been helping, nor has the --help command. Therefore, while I would like the answer, I'd also like to know what the heck I'm doing For example, I know I could delete lines with regex using d/[STUFF I WANT TO DELETE]/g (To get rid of all occurences) and I can substitute using s/foo/bar But I'm unaware of anyway to ADD text upon certain occurences, let alone two different circumstances.

View 6 Replies View Related

General :: Find EOF Char In File?

Dec 10, 2010

How to find EOF char in file

View 1 Replies View Related

General :: How To Append Time To Folder

Apr 9, 2010

i just want to create a folder with current time.

For example.

foldername_09042010 How do i modify mkdir or write script to do this?

View 6 Replies View Related

Security :: What Are Strong Iptables Rules?

Mar 31, 2011

Can someone please let me know strong iptables rules? Below entries are in iptables file.Here Y.Y.Y.Y is another branch public IP.This server acts as gateway+squid server.Further it will serve company's intranet page also using httpd.OS is CentOS 5.0.

View 1 Replies View Related

General :: Calling Application From Char Driver?

Oct 13, 2010

I want to call a application file in user space through a character driver running in kernel space.

View 1 Replies View Related

General :: Automatically Append Flags To Certain Commands?

Feb 12, 2011

Greetings, I want to automatically append flags to certain commands. For example, when I type:

ls

at the prompt, I want the

-la

flags automatically appended without me having to type:

ls -la

View 2 Replies View Related

General :: Port Number Auto Append

Jun 20, 2011

we have centos and a win2k8 server. Our pos system is on the centos server. I created a HOST (A) record on win2k8. so users don't have to remember the ip address of the centos server.so i created a friendly name like URL... and the POS web page will be loaded.but my questions is it possible to configure the centos to automatically append the port number if the user type URL... will be auto added at the end of it.

View 3 Replies View Related

General :: Append # Begining File In Perl

Nov 28, 2010

Can you please let me know how can i append # in the begining of each line Based on a a search string lile /^8282##8282/gc

View 1 Replies View Related

General :: Gzip Command To Append Some Files

Feb 21, 2011

I have a existing zipped file , I want to use gzip command to append some files to it , I tried man gzip but can't find the key word "append" , can advise how can I do it ?

View 1 Replies View Related

General :: Sed: -e Expression #1, Char 27: Unterminated `s' Command

Feb 3, 2011

I am trying the execute the following

#!/usr/bin/python
import os
os.system("sed -e 's#^(.*) (.*)0http://12#' t2.txt > t3.txt")
os.system("cat t3.txt | sort | uniq -c | sort -rn | head > t4.txt")

But I receive the following error message.

sed: -e expression #1, char 27: unterminated `s' command

View 1 Replies View Related

General :: Script To Append Lines To Multiple Files?

Aug 22, 2009

eed to make a script to append a line to the bottom of multiple files (only certain files, but 100's spread over directories).Doing a find replace inside multiple files is easy, I use the followingfind /base/dir -name "*.txt" -exec perl -pi -w -e 's/FIND/REPLACE/g;' {} ;So I tried doing the followingfind /base/dir -name "*.txt" -exec echo "Append this" >> {} ;However this just appends all the text into a file called "{}". Whereas {} should be replaced with each file that's found.

View 1 Replies View Related

Ubuntu Networking :: Wireless Signal Low But Strong In Windows

Jul 7, 2010

My laptop has sat in the same area for days, I've noticed that in Ubuntu I get a real low signal and can barely connect for a minute and on Windows I get like 3/5 bars. I don't understand what's going on. Is it a driver issue or something?My wireless card is Realtek RTL8187B and using the latest Ubuntu as of today.But just so everyone knows, I have google'd and search around for a few hours. I've seen many different types of problems that just wasn't like mine. Lots of people can't even get theirs to work and some people use different types of drivers. But Ubuntu detects my wireless card fine, I'm just having a signal strength problem. Because the Windows on my laptop has a much stronger signal as stated above.

View 2 Replies View Related

Networking :: Not Seeing Strong Connection To MAC/Physical Addressing And Reasoning?

Jul 24, 2011

Why does a NIC need a permanent individual way to distinguish it? Why not give it the host name in a form that is not a permanent hardwired hardware? Seems that the last ethernet router before reaching your PC is really seeking your NIC. So why is not the expression "What is your NIC Address" instead of "What is your IP Address"?

View 5 Replies View Related

General :: Error: Invalid Operands To Binary | (have Char * And ½char)

May 21, 2011

i have problem executing lex program though the code is correct i'm getting some errors and the error says: In function yylex:

error: invalid operands to binary | (have char * and char *)
error: invalid operands to binary | (have char * and char *)
error: expected ; before { token

View 3 Replies View Related

General :: Read From Input File And Append To Multiple Files?

Nov 22, 2010

I wanted to be as clear as possible. I have to add hundreds of new servers to hundreds of configuration files in Nagios. Here is a sample structure:

servers.txt has:
SERVER3
SERVER4

[code]....

View 10 Replies View Related

Debian :: Find + Mount.ntfs-3g Strong Disk Usage

May 10, 2011

Since I installed Debain Squeeze with KDE (for more than a month), there is something I cannot explain to myself. 5-10 minutes after bootup my hard disk begins to work very intensely. Then, after 2-3 minutes it comes back to its normal operation. Using "atop" I found out that the first process that squeezez my HDD is "find". Then, a little bit later, mount.ntfs-3g appears. Both do what they do, then exit and everything's back to normal. What I suppose, is that that something is searching, first on the Linux partitions, then on the ntfs partitions.

Does anybody know what is this phenomenon related to? Or at least, how could I find out. Ah, and to avoid some basic troubleshooting questions: I have 3 GB of RAM, so no swap is needed. And I repeat: it's find and mount.ntfs-3g that use the HDD.

View 10 Replies View Related

Fedora Networking :: Signals Strong But Broadcom 4318 Very Slow?

Nov 19, 2009

I've got the b43 driver and firmware installed, and the system comes up fine, but the max throughput on the wlan0 is about 100Kb/s. My laptop and iwl do about 2.5Mbps from the same location in the house. The signal is plenty strong:

wlan0
IEEE 802.11bg ESSID:"sar2"
Mode: Managed Frequency:2.422 GHz Access Point: 00:23:69:22:5C:00
Bit Rate=36 Mb/s Tx-Power=20 dBm
Retry min limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=61/70 Signal level=-49 dBm Noise level=-57 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Is this expected from the b43 driver and a bcm4318? I was hoping for much better throughput. Also, I tried the broadcom-wl driver, but it doesn't seem to recognize the card. It looks like it's not supported from their site, only the 4311,12,21,22 were listed, although I see posts where other people claim they are using it with a 4318?

View 5 Replies View Related

General :: Sed - Append Four Commas ',,,,' At The End Of Lines Containing The Pattern 'Response' In A Text File

Nov 5, 2010

Using sed, I am trying to append four commas ',,,,' at the end of lines containing the pattern 'Response' in a text file with lines such as these:

6,Pulse,50,254968,14886,NA,,,,
7,Picture,8,265157,0,1,15045,2,0,15000
7,Response,1,271553,6396,1
7,Pulse,50,274969,9812,NA,,,,
8,Picture,1,290232,0,1,15045,2,0,15000
8,Pulse,50,294969,4737,NA,,,,
[Code].....

View 1 Replies View Related

General :: Bring Cursor To 1st Char In Current Line (Command Mode)

Dec 4, 2010

Just in case someone can reply a silly question, I've quite forgot the vi/vim command to bring the cursor to the 1st char in the current line. I do remember that for bringing it to EOL is '$'.

View 14 Replies View Related

General :: Append Command Output To File By Giving Command In Terminal?

Jul 3, 2009

I am using openSUSE 10.3.When I install software from tarball then to record time required I send output of date to beg.txt(when installation begins) and end.txt (when installation finishes).How can I append output of date to a file so I don't need two files?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved