LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 02-13-2008, 03:57 AM   #1
sandsterother
LQ Newbie
 
Registered: Feb 2008
Posts: 1

Rep: Reputation: 0
Shell script using zenity


I'm using the following code for file selection using zenity:

pcap=$(zenity --file-selection)
echo "Pcap file:$pcap"

Displays the following o/p:

Pcap file:/home/d/test.pcap

But at the same time if I echo the o/p as:

echo "Pcap file:$pcap ready"

I'm getting the following o/p:

readyle:/home/d/test.pcap

I wanted to know how to avoid these line feeders in shell script.
same as using chomp() cmd in perl scripting.
 
Old 02-14-2008, 02:16 AM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
echo -n
see http://www.tldp.org/LDP/abs/html/internal.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing variable from zenity to rest of script snowman81 Programming 3 01-22-2008 12:11 PM
Brain cramp using zenity in script ?? wmcase Programming 2 12-03-2006 03:20 PM
I made a shortcut to a shell script and it is using default shell icon... shlinux Linux - Software 2 04-20-2006 07:29 AM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 03:34 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 06:32 PM


All times are GMT -5. The time now is 05:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration