10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi,
I'm trying to calculate IP addresses and their respective calls to our apache Server. The standard format of the input is
HOST IP DATE/TIME - - "GET/POST reuest" "User Agent"
HOST IP DATE/TIME - - "GET/POST reuest" "User Agent"
HOST IP DATE/TIME - - "GET/POST reuest" "User Agent"
HOST... (2 Replies)
Discussion started by: busyboy
2 Replies
2. Shell Programming and Scripting
In Shell, I have output of a unix command as
test1
test2015
but I want it as
test1 test2015
can anyone help me out.
Use code tags, thanks. (3 Replies)
Discussion started by: OscarS
3 Replies
3. UNIX for Advanced & Expert Users
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
4. Shell Programming and Scripting
Hi, I have the following command that parses an xml file to read a node <port>'s value. Hoever the output comes with spaces.
My requirement is to trim the spaces around the value and assign to a variable.
sed -n 's|<port>\(.*\)</port>|\1|p' ../cfg.xml
How do I go about it? (6 Replies)
Discussion started by: sai2013
6 Replies
5. Shell Programming and Scripting
Hi,
Consider the data (FS = |):
1| England |end
2| New Zealand |end
3|Australia|end
4| Some Made Up Country |end
5| West Indies|end
I want the output to be (i.e. without the leading and trailing white space from $2)
England
New Zealand
Australia
Some Made Up Country
West... (4 Replies)
Discussion started by: Storms
4 Replies
6. Shell Programming and Scripting
HI Guys
I have written a script using awk to split a file based on some identifier and renaming the file based on two values from specific length. ts a fixed width file.
When I am trying to fetch the values
a = substr($0,11,10)
b = substr($0,21,5);
i am getting spaces in a and b values .... (6 Replies)
Discussion started by: manish8484
6 Replies
7. Shell Programming and Scripting
Hi guys ,
I m developing a script in linux.but getting confused about how would i trim my variable if there is any space.
for example.
I m storing value in a variable named MACHINE_NAME
if MACHINE_NAME=<space><space><space>ABCDF<space><space>
How would i trim it to have my MACHINE_NAME=ABCDF... (5 Replies)
Discussion started by: pinga123
5 Replies
8. Shell Programming and Scripting
Hey , I'm new to Bash and am having trouble with writing a script.
I have a variable and want to use it to create a tar file, but, I am having problems. Can anyone tell me what I'm doing wrong?
filestr=`date "+%y-%m-%d %H.%M.%S"`.tar
tar -cvf $filestr test.txt
So, basically,... (3 Replies)
Discussion started by: beefeater267
3 Replies
9. Programming
I am coding a C program to read a plain text file. There are a lot of blank fields or a string with white spaces. I want to know is there such a function called trim() in C to clean the white space around a string? Or some other way can do this efficiently? Thanks. (18 Replies)
Discussion started by: hxm1303
18 Replies
10. Shell Programming and Scripting
Dear all
I had two separate variable. Now i want to make them merge into one new variable with space between them. Kindly suggest me.
var1=dec 15
var2=10
i want var3=dec 15 10
My main aim is as below:
op of date command:
>date
>Sat Dec 15 10:17:35 IST 2007
i want only Dec... (2 Replies)
Discussion started by: jaydeep_sadaria
2 Replies