For example, I have a simple text file
when I use this command,
then I echo temp, the result is in one line.
My variable doesn't have newline.
How to make the newline still exist?
And when I echo my variable, it shows same exact form of content.
thanks
Hi everybody
I looking the put the result of a commane to a Variable
i explain
here is my command:
FJTS_UK:root:common@ukaix3:/> cat sortie | grep "^"| awk '{ print $1}'
15
FJTS_UK:root:common@ukaix3:/>
sortie is a texte file
I want to put the result of commande in a... (1 Reply)
How to put a line of strings (with some white spaces in between) from a file into variables?
I have tried the following codes. However, the content is cut by space (not by line)
for i in `cat ${source_file}`
do
echo $i
done
Please comment. Thanks. (2 Replies)
I have a file that contains the following lines
the brown quick fox
jumped over
the white laze dog
0123456789
I wanted to put the contents of this file into a variable so I used this code:
VAR_LIST=`cat $2`
where $2 is the file name passed as an argument to the script
If I... (3 Replies)
Hello!
I'm having problems trying to extract the contents of a variable and placing it into a text file. Grateful for any help.
Been trying something along the lines of:
$variable > file.txt
or
`cat < $variable` > file.txt
As you can see I'm a newbie to this :D (2 Replies)
Hi all,
I have a problem here. I have a file and let we take the content of the file is just '32' (only a numeric value in that file). Now I need to assign this numeric value ( value in that file) to a variable. Is that possible? If so, can you plz advice me on this?
Thanks in... (4 Replies)
I may not being doing this description justice, but I'll give it a try.
I created a mailx script; there will be several messages using the same script where the only difference is the content. So I figured I'd make the content of the message a variable retrieved from a separate file. I have five... (5 Replies)
Hi i have need of read a file value with cat command and remove first 2character for example cat /sys/class/rtc/day
0x12
Remove char
12
And put this value in a variable
is possible with a script thanks for help (6 Replies)
hi i just cant figure out how can i do this ls -lt > log.txt using $PWD
what i mean is how can i get the ls command content into a file using $PWD variable? :confused: (4 Replies)
Hello,:p
I made a script which do a backup on remote servers with a rsync command. I have a config.cfg with the IPs and the paths where it will copy the directory. The problem is that it doesn't match the paths, So, here my script and its output with the debug :
#!/bin/bash
# PATHS... (7 Replies)
i am having some bash script which must use first sentence of the file. For example i have file which content is:
test 213
So I must use word test into my bash script, and put it into variable.
I am using a one variable named value
value=$(</home/rusher/test.txt)
so instead using test.txt... (1 Reply)
Discussion started by: tomislav91
1 Replies
LEARN ABOUT DEBIAN
notedb::text
NOTEDB::text(3pm) User Contributed Perl Documentation NOTEDB::text(3pm)NAME
NOTEDB::text - module lib for accessing a notedb from perl
SYNOPSIS
# include the module
use NOTEDB;
# create a new NOTEDB object
$db = new NOTEDB("text", "/home/tom/.notedb", 4096, 24);
# decide to use encryption
# $key is the cipher to use for encryption
# $method must be either Crypt::IDEA or Crypt::DES
# you need Crypt::CBC, Crypt::IDEA and Crypt::DES to have installed.
$db->use_crypt($key,$method);
# do not use encryption
# this is the default
$db->no_crypt;
# get a single note
($note, $date) = $db->get_single(1);
# search for a certain note
%matching_notes = $db->get_search("somewhat");
# format of returned hash:
#$matching_notes{$numberofnote}->{'note' => 'something', 'date' => '23.12.2000 10:33:02'}
# get all existing notes
%all_notes = $db->get_all();
# format of returnes hash like the one from get_search above
# get the next noteid available
$next_num = $db->get_nextnum();
# modify a certain note
$db->set_edit(1, "any text", "23.12.2000 10:33:02");
# create a new note
$db->set_new(5, "any new text", "23.12.2000 10:33:02");
# delete a certain note
$db->set_del(5);
# turn on encryption. CryptMethod must be IDEA, DES or BLOWFISH
$db->use_crypt("passphrase", "CryptMethod");
# turn off encryption. This is the default.
$db->no_crypt();
DESCRIPTION
You can use this module for accessing a note database. This backend uses a text file for storage and Storable for accessing the file.
Currently, NOTEDB module is only used by note itself. But feel free to use it within your own project! Perhaps someone want to implement a
webinterface to note...
USAGE
please see the section SYNOPSIS, it says it all.
AUTHOR
Thomas Linden <tom@daemon.de>.
perl v5.10.1 2008-11-17 NOTEDB::text(3pm)