LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-03-2013, 05:06 PM   #16
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,632

Rep: Reputation: 704Reputation: 704Reputation: 704Reputation: 704Reputation: 704Reputation: 704Reputation: 704

Quote:
Originally Posted by unSpawn View Post
Please show me what command line you propose to have bonnie++ perform a network performance test then?
Here's one I was using recently to test nfs-mounted file transfers:

Code:
mount -v rpbnx:/data /data
 ./bonnie++ -d /data -s 512:32k  -u root  -m bnx2x -f -b -n 0 -q -r 0
 
Old 06-04-2013, 03:50 AM   #17
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,245

Rep: Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326
Re shopt:
According to both http://linux.die.net/man/1/bash and my local (Centos 6.4) man pages 'nounset' is not a valid option for shopt.
Have you checked your local manpages?

Quote:
-s Enable (set) each optname.
-u Disable (unset) each optname.

Unless otherwise noted, the shopt options are disabled
(unset) by default.
 
1 members found this post helpful.
Old 06-04-2013, 04:15 AM   #18
jwouter
LQ Newbie
 
Registered: Jun 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Ok thanks for that, I thought as much.

My script is coming along ok, so time for some more advance add-ons.

I would like the user to input the following values at the start of the script:

location
building
room
port identifier


The entry's should be save as variables and later (parts) of those entry's shoudl be reused in the naming of the report files.

Before I start researching , is this possible? if so does any one have sample code on how to do the user input and set is as a variable ?


Thanks in advance for any help , suggestions or insights.

Regards,
joli-coeur Wouter
 
Old 06-04-2013, 05:30 AM   #19
jwouter
LQ Newbie
 
Registered: Jun 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Good day,

I have added the following code to my script and it seems to work.
However, how do I get the filename to use variables in its name
I would like something like
Code:
"$location""$building"-report.txt

Code:
report="/home/report.txt"
#
echo "Hello please fill in the new fields!"
#
echo -n "Enter your location and press [ENTER]: "
read -n 3 location
echo
echo -n "Enter your building and press [ENTER]: "
read  building
echo
grep -i "$location" "$building"
echo "$location $building"  > "$report"

Thanks,
Regards,
Joli-coeur Wouter
 
Old 06-04-2013, 06:00 AM   #20
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,245

Rep: Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326Reputation: 2326
Code:
report_dir='/home/'
report_name=${location}_${building}_report.txt
echo "data" >${report_dir}$report_name
# or
report=${report_dir}${location}_${building}_report.txt
echo "data" >$report
Basically you can concatenate strings, but embedded vars take form ${var}, so the parser can figure out where the varnames are.
See the links in my post #5
 
1 members found this post helpful.
Old 06-04-2013, 10:15 AM   #21
jwouter
LQ Newbie
 
Registered: Jun 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanks for the sample, worked great after some tweaking.

Moving on to next phase... creating a usb bootable Linux disk with all the required tools and scripts pre-installed.

Thanks again for all the help.

With kind regards,
Joli-coeur Wouter
 
  


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
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 05:21 PM


All times are GMT -5. The time now is 10:19 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration