Ubuntu :: Odify $LS_COLORS Variable To Colorize Documents On A Ls Command?

Jul 3, 2010

I want to modify my $LS_COLORS variable to colorize documents on a ls command. What color would be standard or most logical to the average user?The files I want to colorize are: *.doc *.xls *.ppt *.odt *.ods *.txt *.csv *.html ...I think these files should stand out in a terminal ls output. mp3's and jpg's do, why not business files (documents, spreadsheets, presentations, etc.)

View 1 Replies


ADVERTISEMENT

General :: Assign An "here Documents" Section To A Variable In Bash?

Mar 11, 2011

Is it possible to assign an "here documents" section to a variable in bash?I would like to assign the following to a variable:

Code:
<html>
<body>
<p>THis is a test</p>
</body>
</html>

View 4 Replies View Related

Programming :: Calling Command From History Using Variable Like !$command?

Nov 19, 2008

suppose i store the history number of a command say :

1004 cat file

Then now i want to run it like : !1004 but by using a variable.

command=1004
!$command

i am getting errors like :

command=1004command

View 2 Replies View Related

Ubuntu :: Unable To Open Documents From Command Line?

Jun 3, 2010

Previously I was able to open any document I wanted in the CLI by typing:

Code:
open some_document.txt
Now when I try to do this I get the following:

[code]...

View 2 Replies View Related

Ubuntu Networking :: Printing Documents Via The Command Line?

Dec 2, 2010

how to send a document to print on a network printer (via IP address) from the command line (not a GUI interface).

View 4 Replies View Related

OpenSUSE :: Dolphin - Possible To Colorize Background

Aug 3, 2010

I remember that in konqueror used as filemanager was possible to colorize the background, is this possible with dolphin?? I looked for but in the few options thereisn't any possibility to do this.

View 9 Replies View Related

Ubuntu :: Mapping Windows My Documents Folder To My Documents Folders

Dec 18, 2010

I can access my windows my documentsmusic by mounting my windows drive and browsing to it. I can then playwatch my movies and pics in Ubuntu.But what I really want to be able to do is re-map the Ubunbu docs folder like so:

Ubuntu Pics = Windows My Documents pics.
Ubuntu Videos = Windows My Documents Videos.

I'm not very unix savy so I've been using Ubuntu tweak PersonalDefault Folder Locations setting and browsing to my Windows folders. But it doesn't work.I have managed to make a desktop 'short cut' and that works but I'd rather set the system wide default document folders.

View 5 Replies View Related

OpenSUSE Install :: Change Mountpoint Of Partition / Media / Documents To / Documents

Dec 25, 2009

How can I change the mountpoint of my partition /media/documents to /documents.This is a partition of sdb and a fixed disk.The reason is that /media/ sometimes creates ghostdirectories while /Windows/C never does so, programmes writing/reading from this partition therfore don't work if a ghostdir_ exists.(BTW Suse is on sdb5 and sdb6. on sda is windows and used to be Ubuntu, the Suse-swap is sda5. Windows is out of use.)

View 4 Replies View Related

Debian Configuration :: Colorize Output Of Aptitude As In 'pacman-color'?

Aug 22, 2011

Is there any way to colorize the output of aptitude as in 'pacman-color'? I would like to use ~/.Xdefaults colors.

View 1 Replies View Related

Software :: Documents Saved As MS Word Documents?

Jan 13, 2009

When he saved doucuments in the opens source word processor as a MS Word document, he can't open it. Didn't had this problem until today.

View 2 Replies View Related

Programming :: Using Variable In A Command?

Apr 14, 2011

i'm trying to execute a shell script, i'm trying to use the values in an array for use in a sed command:

sed -n '/Sales ID: ${array[$i]}/,/Totals:/p'

that command creates empty files. so my guess is that its not recognizing the array as an array but as text?
how would i be able to utilize the array in the command? i got it, didnt think that if i doubled up the single quotes that it would work, but this worked:

sed -n '/Sales ID: '${array[$i]'}/,/Totals:/p'

View 4 Replies View Related

Ubuntu :: Variable In A Script Error (command Not Found)?

Jan 13, 2010

I have the following script:

Code:
#!/bin/bash
for HOSTS in server01 server02 server03
do
echo "Connecting to $HOSTS"
echo "Resetting Password"
echo ""

[Code]...

done When I run the script I get an error message on the hosts that says: pass=test command not found. Any ideas why is not taking it as a variable?

View 1 Replies View Related

Red Hat / Fedora :: Assign A Variable To A Command?

Sep 10, 2010

I can print a specific line of a file with:$ sed -n '20p' myFileHow can I store it in a variable (in a shell script)?(I wasn't successful with "myVar=sed -n '20p' myFile" for example)

View 2 Replies View Related

Software :: Scripting : Using A Variable In A Command?

Jan 13, 2009

I need to create a zip file of jpg and bmp files. The zip file is named after the first file it finds which ends with .dat. Here is my script:

Code:

DAT_FILE= `find . -maxdepth 1 -iname "*.dat" | head -1 | sed 's/..(.*)..../1/'`
(cd pics; find . ( -name "*.bmp" -o -name "*.jpg" ) -print | zip ../$DAT_FILE -@ )

BTW my sed command cut off the first two chars and last four chars since find will return the filename is the form of "./filename.dat" and I just want to extract filename. When I run this script, it creates a zip file named ".zip". How do I fix this so the zip file is named after my dat file?

View 3 Replies View Related

Programming :: Store A Command In A Variable?

Jan 28, 2010

Code:

ls Again the command can be stored in a variable and then executed. Like

Code:

var=ls
&var

The above two codes are the same. The problem occurs when we try to pipeline it. Consider the following problem:

Code:

ls | grep *

works fine...but when we try to store it in a variable and run the command there is an error.

Code:

var="ls|grep *"
$var

how to store this kind of commands in a variable?

View 11 Replies View Related

SUSE :: How To Fix $PATH Variable - Command Not Found

Dec 20, 2010

I tried to install JRE to my remote Suse 11 SP1 linux.After i finished with files i typed like

export PATH=<my jre path>

now i have no bash commands - typing ls causes

-bash: ls: command not found

i think that i should re-export my PATH to the right value but i don't know what it should be. I tried differend values

/etc/profile
/usr/bin

View 3 Replies View Related

General :: Better To Use 'at' Command Instead Of Time Variable In Shutdown?

Apr 20, 2010

I was reading that if I want to do a one time scheduled command, I should use at, which I've never done, as opposed to cron, which i'm kinda familiar with. But what I want to do is reboot my server at 3am tomorrow and force it to check the file systems with a shutdown -rF. For this do I even need to use "at" or could I just say shutdown -rF 3:00.Will that also know that I mean 3am tomorrow and not say in 3 minutes from now or 3pm?

View 14 Replies View Related

General :: Any Way To Store Output Of Command Into Variable?

Mar 3, 2010

I tried using the tail command in my shell script and storing that value in a variable a but an error keeps coming. Is there any other way to store the output of a command into a variable. Cannot Read text from text file and store it in a variable using shell script. The thing is I need a number from the file new.txt and use that number in my script

#!/bin/bash
a = `tail -1 new.txt|head -n 1`
echo $a

View 2 Replies View Related

General :: Store Result Of Wc -l Command In Variable?

Apr 19, 2011

I want to store the result of wc -l as a variable so I can use it later in my script...so far unsuccessfully.

I have tried this:

set `echo awk '{ print $1, $6}' | wc -l` | echo $1

but it is far from working.

View 11 Replies View Related

Software :: How To Express Built-In Variable, RS In Awk Command

Apr 26, 2011

I am going to separate records with the string, "[J.System Info]" in awk command.

Both of the following expressions don't work well.

Code:
RS = "[J.System Info]"
(or)
RS = "[J.System Info]"

View 1 Replies View Related

Programming :: Change Variable In Case Command?

Aug 7, 2010

I want to display 4 options using the case command and refresh the screen when options 1 and 2 are chosen (no changes to the options and you get asked again to chose option), but give a message for option 3 and exit on option 4. I set this up with the script below, but choosing option 1 works and choosing option 2 exits the script.

Code:

#!/bin/bash
#testing options
Option="0"

[code]....

View 7 Replies View Related

Programming :: Pass A Shell Variable To An AWK Command?

Dec 23, 2010

I have the following code :

Code:
E_BADARGS=65
if [ $# -ne 2 ] ; then

[code]...

View 1 Replies View Related

Programming :: Assigning Bash Variable With The System Command In Awk?

Mar 1, 2011

I am having all sorts of trouble trying to assign a variable within an awk script with the system command. I know there is a lot of ways around this problem, but for efficiency reasons, I would like to, within my awk script, do something like

system(x=3)

or

system(x=NR)

and, latter on the shell script which calls the awk script, use the variable $x. But nothing is passed to x. I have already tried things like

command = "x=3"
system(command)

and also used a pipeline within the system to pipe it to /bin/sh In fact tried a lot of stuff like that, using $(( )) etc etc etc I can create directories e write to files (yes, i could write to a file and read from there, but I dont think it is efficient, plus I am puzzled).

View 7 Replies View Related

General :: Simple Bash Command Causing Bad Variable Name

Feb 18, 2010

When I run this command from shell, it runs ok
export REVS=`svn info svn+ssh://svn.myone.ca/var/svn/story/trunk/lib |grep 'Last Changed Rev:'| awk -F: '{print $2}'`
However when I save it into a file called test.sh (of course, I chmod it with +x), I got error "export: 2: bad variable name"

Here is the file:
#!/bin/bash
export REVS=`svn info svn+ssh://svn.myone.ca/var/svn/story/trunk/lib |grep 'Last Changed Rev:'| awk -F: '{print $2}'`
I am using ubuntu.

View 7 Replies View Related

General :: Does The Output Of The Previous Command Get Stored In Any Variable

Mar 26, 2011

For example, when using bash you can use

Code:

to execute the previous command or

Code:

!<number> to execute the Nth command(use history to see the list). Or you can use

Code:

cd !-2:1

to cd into the value in the first field that was executed 2 commands ago Anyhow, say I run a command and the output is a path. Any way to cd and then some variable where OUTPUT of the previous command was stored? A variable that always stores the OUTPUT of the last command.

View 8 Replies View Related

General :: Environmental Variable In Bash Command String?

Feb 9, 2011

I do this:

Code:

a@b:~$ export A=hi
a@b:~$ echo $A
hi
a@b:~$ bash -c "export A=blah; echo $A"
hi
a@b:~$

Why doesn't the bash command print the new value of $A? Is there a way to make it do so?

View 6 Replies View Related

General :: PATH Variable - Command Not Found On New Terminal

Aug 3, 2011

I am using CentOS5.5 & everytime it is showing command not found. If I export the path as below it will be working fine until a reboot. Again same error i.e command not found if I open new terminal. Every time I am exporting as below:

#export PATH=/sbin/:$PATH
#export PATH=/usr/sbin/:$PATH
#export PATH=/usr/bin/:$PATH
#export PATH=/bin/:$PATH

How can I set these permanently as that the paths should automatically be exported for everyone user whenever the system boots. And command completion also should happen for eg. #fdi (press tab), then it should show available options such as fdisk, etc.

View 7 Replies View Related

General :: Variable Storing The Previously Executed Command?

May 23, 2010

I want to use PROMPT_COMMAND variable to build a history of all the commands i execute. So Basically i want to append the last executed command to my own command log file. How can i find the last executed command ?

I want to add PROMPT_COMMAND="echo $last_executed_command >> my_command_log" But I am not sure how to find the last executed command

View 2 Replies View Related

Programming :: Put A Variable In The $PS1 Prompt That Will Change Each Time A Command Is Run?

Feb 11, 2011

I would like to put a variable in the $PS1 prompt that will change each time a command is run. I want the color of the $PS1 prompt to change each time a command is run.I know that I can do this:

Code:
PS1="h@w # "
## "#" is changes every time a command is run

[code]....

View 9 Replies View Related

Programming :: Receive Command Output And Store It To A Variable?

Apr 3, 2010

Suppose I want to account number of files beginning with abc , I can use "ls 'abc* | grep abc | wc -l", this will return me a number.
I want to store this number in a variable, say var1, so I tried
1. "ls 'abc* | grep abc | wc -l |read var1", but this didn't work as var1 has no value somehow.
2. var1='ls 'abc* | grep abc | wc -l', this just assign the entire string "ls 'abc* | grep abc | wc -l" to var1, which is not I wanted.

I don't want to store the value to a temporary file and then read the value from that file. I think there should be a direct way to get the value, but don't know how. I know in tcsh, one can just use set var1='ls 'abc* | grep abc | wc -l', but it also doesn't work in bash. Can anyone give any clue about this?

View 5 Replies View Related







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