Ubuntu :: Creating A Text File To Start Up Sudo Bash Without Going To The Terminal?

Feb 26, 2011

I just set up apache on my PC and I cant change the permissions by right clicking because "I'm not the owner" and instead of using the chmod command on every file that I would like to edit I would just like to write a script on a text file, save it to my desktop so all I have to do is double click on it and boom I can edit all my files, etc.

View 2 Replies


ADVERTISEMENT

Fedora :: Run (not Run In Terminal) Bash Script With Sudo In It?

Jul 6, 2010

I have written a tiny script which switches between 2 CPU frequency throttling governors. Now I need to assign it to a shorcut key though "Preferences->Keyboard Shortcuts".

Here is the script:

Code:

#!/bin/bash
if [ `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor` = 'ondemand' ]
then

[code]....

As you can see this script involves sudo. I know that usually running commands with sudo requires "Run in Terminal" option for a shortcut, but in "Keyboard Shortcuts->Add" there is no option to run command in terminal. When I double click on the script and choose "Run in Terminal", then it functions as it should. How can I make this script execute by doing "Run" and not "Run in Termnal"?

View 2 Replies View Related

Programming :: Creating A Text Based Menu Structure In Bash?

May 15, 2009

Is it possible to create a text based menu layout in bash were it is possible to browse through. The menu list should look something like this:

----------------------------------------
user: root
colour: blue
number: 4
animal: dog
----------------------------------------

At the start the cursor should blink at the r from root so that text can be entered. When pressing the enter the cursor should go to the b from blue and so on. the imported thing is that all the text is visible also beyond the position from the cursor.

View 4 Replies View Related

General :: Put Custom Text On Terminal (bash Script)?

Jan 19, 2010

This code:

Code:
#! /bin/bash
echo Okay.
echo
Does not do it....

P.S. I want to show my parents what happens when I do:

Code:
sudo make me a sandwich
and have it say "Okay."

View 11 Replies View Related

General :: Select Text In BASH Terminal Using The Keyboard Without Mouse?

Jan 2, 2011

How to select text in BASH terminal using the keyboard without mouse? I'm using Ubuntu 10.10

View 1 Replies View Related

Slackware :: Start A Terminal With Pre-typed Text?

Apr 17, 2011

Does anyone have tips for starting a virtual-terminal with pre-typed text?

This starts 'xterm' and keeps open at desired directory:

Code:
xterm -title installed software packages -e 'cd /var/log/packages && /bin/bash'

But I want to be even more lazier and have 'ls | grep -i ' already pre-typed so I can quickly search/ls packages by name.

Code:
david@slackware13:/var/log/packages$ ls | grep -i <READY FOR MY TEXT>

Code:
david@slackware13:/var/log/packages$ ls | grep -i CALC
xcalc-1.0.2-i486-2

View 2 Replies View Related

Ubuntu :: Text Terminal Unreadable - Can't Start Gdm Even After Memorizing The Process Of Logging In And Starting Gdm

Jul 9, 2010

My terminal text is unreadable. Where as the default output would usually fill half the screen it probably fills around 1/20th now. Basically it looks like the text is 1px in size. I was about to install a graphics driver (nvidia) but doh I can't see what I'm typing... I can't start gdm even after memorising the process of logging in and starting gdm (I think gdm is failing to start anyway) I'm using the default xorg.conf provided with the LiveCD;

[Code]....

View 2 Replies View Related

Programming :: Bash Script To Start Gnome Terminal?

Apr 8, 2010

I want to write a bash script which can open a new gnome-terminal window.
In that gnome-terminal window, it should goto a specific directory and edit a file using Vi Editor.

How is it possible to do that?

View 7 Replies View Related

Programming :: Creating A Ftp Script That Will Take Connection And File Details From Text Files?

Nov 23, 2010

I need a little help creating a ftp script that will take connection and file details from text files.For example:ftpscript.sh - script that looks for details and does transferftpparams.txt - ftp server connection details in single line csv formatftpfiles.txt - files that need to be transfer, one file per line.I have tried using awk with no success

View 2 Replies View Related

General :: Creating Bash File That Changes Decimal To Binary Using Obase?

Apr 21, 2011

Code:
#!/bin/bash
echo 'obase=2;10'|bc

[code]...

View 2 Replies View Related

Ubuntu Multimedia :: Creating ISO File In Terminal - Input / Output Error

Feb 15, 2011

I'm trying to create an iso file in a terminal with the following command:
$cat /dev/sr0 > nameofdisk.iso
I get the following error
cat: /dev/sr0: Input/output error
I already checked and my optical drive is indeed /dev/sr0. I've hunted google a few hours trying to figure it out. Does anyone know why I'd be getting this error?

View 4 Replies View Related

Ubuntu :: Bash Scripting: Making A Text File

Jul 12, 2010

I am tying to write a script that asks for user input and saves it to a text file using awk so example #!/bin/bash read a awk #saves to file

I had a working scripted last night, deleted it by mistake and for the life of me can not remember how i did it.

View 2 Replies View Related

Ubuntu :: Windows Text File Won't Run As Bash Script?

Mar 21, 2011

I created text for a bunch of "#!/bin/bash" scripts in MS SQL Server. Being on a Windows machine, I used Ultraedit to create text files for a few examples. After copying the files to a machine running Ubuntu 10.10, I changed group and owner, and made them executable. However, they won't execute. I get "file not found" errors. But, if I paste the content into text files created in Ubuntu, it runs fine.

View 1 Replies View Related

Programming :: Reading From Text File In Bash?

Nov 8, 2010

I need to Read a path of a file witch is written in Text file i used this

Code:

FILENAME=$1
while read line
do
echo $line
done < $FILENAME

it worked and showed me the Line witch was written in my file but now my problem is how am gonna use that line as a path i mean for example if am gonna execute a linux command on that file like dpkg -i /path/to/the/file how am gonna export it from The $Line variable and use it after the command.

View 14 Replies View Related

Ubuntu :: Bash Command To Find And Replace Text In File

Apr 3, 2010

I'm having problems with Tomboy. I have a few hundred note files and I need to go through all of them and replace all instances of "<link:broken>a</link:broken>" with "a". Is there a bash command I can use to do this?

View 2 Replies View Related

Programming :: Bash: Split A Text File Into An Array?

Sep 18, 2010

I have a file (called twitterstatus.tmp) that looks like this:

Code:

<status>
<id>24854489768</id>
<text>Are we gonna ride the sun home?</text>
<id>55266987</id>

[code].....

How could I feed this into an array, with each element containing everything between the <status> </status> tags?

View 9 Replies View Related

Programming :: Get The Specific Text From A Txt File In Bash Script?

Apr 30, 2010

I have a text file which stores the list of files & dir, I want to get only file's extensions from this file & want to store it in another file.eg, below is the file's contents & from it I want to get the extensions sh, pl & h & want to store it in another file. Also I don't want directory list.

A scripts/services_restarter.sh
A scripts/svn post_commit scripts
A scripts/tmp/

[code]...

View 8 Replies View Related

Fedora :: Write A Bash Script That Will Create A New Text File?

Oct 22, 2009

trying to learn how to write a bash script that will create a new text file named jimbola in my home directory. The file will need to be able to have the first and last name of Jim Bola included in it.

View 4 Replies View Related

Programming :: Write An If Statement For The First Line Of A Text File Bash?

Feb 15, 2011

At the moment I got my md5sum checking working which I write to a text file and see below.

If the md5sum works it will write the output to check2.md5 test.txt: OK

If the md5sum fails it will write test.txt: FAILED

How do I write if statement to check the output whether or not the md5sum failed or not ?

check1="/home/ops/Desktop/test1/check1.md5"
check2="/home/ops/Desktop/test1/check2.md5"
cd /home/ops/Desktop/test1
md5sum test.txt > $check1

[Code]....

View 2 Replies View Related

Programming :: Find String In Text File (bash Script)

Apr 17, 2011

write such script (bash script). I have some text file with name filename.txt I must check if this file contains string "test-string-first", I must cut from this file string which follows string "keyword-string:" and till first white-space and save it to some variable.

For example. File: PHP Code: PHP Code:
Start 15022011 Eng 12-3-42
SN1232324422 11 test-string-first
SN322211 securities
HH keyword-string:123456321-net mark (11-22) 

[Code].....

View 1 Replies View Related

General :: Write A Bash Script To Parse A Text File?

Apr 27, 2011

I want to write a bash script to parse a text file with the following lines and set variables for each line so that I can use them in the rest of the script.

Timestamp=123456789
Company=ABC Company
Server=Server
Recipient=Joe Smith
Email=joe@abc.com

simplest way to read each line one at a time for everything before the =, set that to a variable name with the value equal to everything after the =

View 14 Replies View Related

Programming :: (BASH) How To Read Multiple Lines From Text File

Mar 11, 2011

For example, I have a text file with data which lists numerical values from two separate individuals

Code:
Person A
100
200
300
400
500
600
700
800
900
1000
1100
1200

Person B
1200
1100
1000
900
800
700
600
500
400
300
200
100

How would I go about reading the values for each Person, then being able to perform mathematical equations for each Person (finding the sum for example)?

View 13 Replies View Related

Programming :: Bash: Feeding Input To A Script From A Text File?

Nov 17, 2010

I have a script which checks on my jobs that run on some cluster.The script, "script.sh", takes as an input the job-id for the job to be checked. Sometimes I have 100s of jobs and I want to check them all (for successful completion.) I could put these job-ids into a text file, "job-id.txt", each id in its own line.For each job-id, the script would ask me few questions (with a yes or no answers) to see if I want to do some other checks for each job-id.I want to know how may I direct my job-ids from this text file into the script one job-id at a time.

View 14 Replies View Related

Programming :: Bash Scripting - Parsing Text File By Character

Aug 11, 2009

Is there a way to process individual characters one-by-one from a text file in Bash, or is that hoping for a little too much from this lovable old clunker?

View 13 Replies View Related

Programming :: Parse Multiple Variable From Text File With Bash?

Jul 13, 2010

I am trying to think of a logic where my file contains some data I had to read and do some processing. Issue is that file contains data multiple times. For example:

:::::::::::
var1=value1
var2=value2

[code].....

I have to read first paragraph of variables and do some processing and then move on until the end of file. Variable names are same in whole file but for each paragraph the value is different. I can't think of a logic to attain this task. How can I do it? It should be a simple bash script, but I am not able to work out.

View 2 Replies View Related

General :: Read A Text File And Ftp Files Using Bash W/out Leaving The Ftp Prompt

Oct 9, 2009

I have a script almost working except for 1 thing. What I'm trying to do is read a file that has the files that need to be FTP'd using a bash script. I have everything working except the reading of the file. It works outside of the ftp script I've wrote but once I put it in the FTP script it doesn't.

Here's the Script:

#Here's where the problem is that I know of

I've been playing w/ the exclamation points to see if that could be the problem, but so far no luck.

View 6 Replies View Related

General :: Write A Bash Script That Will Read The Word From The Text File?

Jun 10, 2011

I have a text file that contains a single word and I want to write a bash script that will read the word from the text file... The following is my incorrect attempt, as it assigns the name of the textfile to the variable as opposed to the word stored within the textfile:(assume I have a text file value.txt that has its contents a single word, say wordone)

Code:
#!/bin/sh
for f in value.txt
do
echo $f
done

so the output of the above script is value.txt, however I want it to be wordone.to summarise: how do I assign the value of the word contained within a textfile to a variable?

View 1 Replies View Related

General :: Convert A Text File From Shift JIS To UTF-8 And Back From The Terminal?

Jul 21, 2011

In order to make this conversion I have to use a text editor. This is tedious. Is there an easier way to do it, like some program I can run from the Linux or OSX terminal?

View 1 Replies View Related

Ubuntu :: 11.04 "bash: Sudo: No Such File Or Directory"?

Jul 9, 2011

This is the same with git. I'm not sure if any other commands are like this, but I know that both of those commands are installed.

View 9 Replies View Related

Ubuntu :: Bash Script - Start A Process Then Close Terminal With In The Script?

Jan 1, 2010

I have got a bash script i have been playing with I need to start a process then close terminal with in the script but leave program running ?

Code:
#!/bin/bash
sudo ifconfig eth0 down
sleep 5
sudo ifconfig eth0 up
firefox & exit

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved