I'm pretty new to bash scripts and I'm trying to work through some issues. Would appreciate any suggestions.
I have a list of servers in a text file (I used the FQDN's), I assign the file name to a variable, I then use cat to read the list of file names and echo them to the screen. But when it assigns the variable it seems to append a \r to the end of the variables value. Although the \r doesn't show up unless I use the set command to debug. As you can see from code below, I'm trying to use a server list to perform a secure copy of my password files so that I don't have to log on to each server. Here is the code snippet in question:
Here's what the output from the script looks like:
Quote:
[root@netbkpmaster passwd_audit]# ./getinfo_script
+ FILENAME=server_list.txt
+ cat server_list.txt
+ read LINE
+ echo $'api01r5v.lamar.edu\r'
api01r5v.lamar.edu
+ read LINE
+ echo $'appworxdbdev.lamar.edu\r'
appworxdbdev.lamar.edu
+ read LINE
+ echo $'appworxdbprod.lamar.edu\r'
appworxdbprod.lamar.edu
+ read LINE
+ echo $'appwxdbdevr5p.lamar.edu\r'
appwxdbdevr5p.lamar.edu
Is this normal behavior? I've used this same script in the past and it's worked fine for me. Not sure why it changed suddenly. Any suggestions would be greatly appreciated.
I have a script I use on my web server (Apache2). I am changing to Lighttpd and need to make a few changes.
This is what I use on my apache server
#!/bin/bash
# accepts 3 parameters: <domain name> <user name> <XXXXXXXX>
# domain name is without www (just domain.com)
# username would be... (3 Replies)
Hi,
I am trying to output a set of fields to a file:
set outFile "printHeader.tmp"
set dbFields "REPORT.TIMESTAMP.s,REPORT.CUSTOMER.s,REPORT.CODE.s"
puts $dbFields > $outFile
I receive the following error message:
bad argument "printHeader.tmp": should be "nonewline"
... (2 Replies)
Hi All,
I need to pass a variable to perl script from bash script, where in perl i am using if condition. Here is the cmd what i am using in perl
FROM_DATE="06/05/2008"
TO_DATE="07/05/2008"
"perl -ne ' print if ( $_ >="$FROM_DATE" && $_ <= "$TO_DATE" ) ' filename"
filename has... (10 Replies)
Hello kind programmers :)
I am a newbie and running into an error "line 28: syntax error: unexpected end of file" on the script shown below. Any help would be greatly appreciated. Thanks!
#! /bin/bash
if ($#argv <3) then
echo 'Usage get_modis_snow '
echo 'ftp script for MYD10A2... (2 Replies)
There is a same named log file that I have on my 2 different android phones. When I plug it into my computer, it appears in the media folder, For example the first android phone:
/media/F6BA-0AF5/folder/A.log
I want to put that into a variable to be manipulated.... (3 Replies)
Hello Folks,
I must be blind that I cant figure out this perl script why I end up with ;; at the end of the line.
I am not an expert by any means
#!/usr/bin/perl
use File::Find;
open F,shift or die $!;
my %ip=map/(\S+)\s+(\S+)/,<F>;
close F;
find sub{
if( -f ){
local... (4 Replies)
Hi
I am setting the variables like this :
setenv MODULE1 modem5__3
setenv MODULE2 modem5__2
setenv MODULE3 modem_ctrl_1_1
setenv MODULE4 modem_1_0
setenv COUNT 10
I am having a bash script as shown below
################################################
#!/bin/bash
for ((... (5 Replies)
Hi all,
I have a little problem with a expect in a bash Script.
The hull of my script:
#!/bin/sh
( expect -c '
set a \"eee\"; # the variable a
' )
echo $a; # using the variable out of the expect script
I would like to use the variable out of the expect script(in bash),... (3 Replies)
Hi All,
Sorry for long topic here.
So the drill goes like that, I need a script which gathers different values from different files/locations.
A_CT=`cat a.dat | awk -F'|' '{print $1}' >> report.txt`
B_CT=`cat b.dat | awk -F'|' '{print $3}' >> report.txt`
C_CT=`cat c.dat | awk -F'|'... (4 Replies)
Hello,
I'm works on Ubuntu server
My goal : I would like to read file line per line, but i want to started at the end of file.
Currently, I use instructions :
while read line;
do
COMMAND
done < /var/log/apache2/access.log
But, the first line, i don't want this. The file is long... (5 Replies)
Discussion started by: Fuziion
5 Replies
LEARN ABOUT DEBIAN
gedit
GEDIT(1) General Commands Manual GEDIT(1)NAME
gedit - text editor for the GNOME Desktop
SYNOPSIS
gedit [OPTION...] [FILE...] [+LINE[:COLUMN]]
DESCRIPTION
gedit is the official text editor of the GNOME desktop environment.
While aiming at simplicity and ease of use, gedit is a powerful general purpose text editor. It can be used to create and edit all kinds
of text files.
gedit features a flexible plugin system which can be used to dynamically add new advanced features to gedit itself.
OPTIONS -b, --background
Run gedit in the background.
--encoding
Set the character encoding to be used for opening the files listed on the command line.
-g, --geometry=GEOMETRY
Set the X geometry window size (WIDTHxHEIGHT+X+Y).
--list-encodings
Display list of possible values for the encoding option and exit.
--new-window
Create a new toplevel window in an existing instance of gedit.
--new-document
Create a new document in an existing instance of gedit.
-s, --standalone
Run gedit in standalone mode.
-w, --wait
Open files and block the gedit process.
--help Prints the command line options.
--version
Output version information and exit.
FILE Specifies the file to open when gedit starts. If this is not specified, gedit will load a blank file with an "Unsaved Document"
label. Multiple files can be loaded if they are separated by spaces. gedit also supports handling of remote files. For example, you
can pass the location of a webpage to gedit , like "http://www.gnome.org", or load a file from a FTP server, like
"ftp://ftp.gnome.org/robots.txt".
+LINE For the first file, go to the line specified by LINE (do not insert a space between the "+" sign and the number). If LINE is miss-
ing, go to the last line.
COLUMN For the first file, go to the column specified by COLUMN. If COLUMN is missing, go to the first column.
BUGS
If you find a bug, please report it at http://bugzilla.gnome.org/enter_bug.cgi?product=gedit.
AUTHORS
Paolo Maggi (paolo@gnome.org)
Paolo Borelli (pborelli@katamail.com)
Steve Frecinaux (code@istique.net)
Jesse van den Kieboom (jessevdk@gnome.org)
Ignacio Casal Quinteiro <icq@gnome.org>
James Willcox (jwillcox@gnome.org)
Federico Mena Quintero (federico@novell.com)
Chema Celorio
17 May 2010 GEDIT(1)