Tagged Questions
Bash is the shell from the GNU project. Is it the standard shell on Linux and often available on other unices.
1
vote
1answer
27 views
Convert pdf to jpg keeping the same name; resize & create thumbs then rename?
I have a lot of pdf files (3308) on which I must apply four steps:
1) I have to convert all to jpg
I found this little script on the web with ImageMagick: batch converting pdf to jpg
I want to do ...
0
votes
3answers
41 views
Bash prompt keeps disappearing
I have a weird issue where my Bash prompt often completely disappears on a backspace. Doesn't make any sense to me, but it happens often:
I can't really think of why this is happening. Am I ...
1
vote
3answers
61 views
Evalute passed in variable in bash
Is there a way to pass in a variable as an argument to a bash script and have it evaluated scoped by the bash script?
Given:
# cat /path/to/file/of/host/names
bob
tom
joe
etc...
# dofor
FILE=$1
...
1
vote
2answers
37 views
How to execute script on logging out?
I'm reading The Unix Programming Environment.
There is an exercise question to print how much CPU time you have consumed when you log off by editing .profile.
I tried with this
trap 'times' 0 1 2 15
...
0
votes
0answers
32 views
bash_profile problem with alias [closed]
I have a .bash_profile file containing a number of bash customizations. I have the same file on a Linux server and locally on my Mac. On the server, everything behaves as expected. However, locally on ...
0
votes
1answer
83 views
Finding duplicate files
I need to write a bash script that finds duplicate files, but in addition to md5sum it needs to use cmp to do the final check. I tried the command below in my shell. How can I add a loop and put it ...
2
votes
1answer
20 views
XFCE or pure X11 commands , disable / enable composite immediately without restart of X
How can i diable Composite in command line ? i needed to disabled temporarily for some games , like Nexuiz , which is a script that i can wrap it with commands to alternate composite status.
3
votes
1answer
40 views
send html using mailx
I'd like to send a html file from a host using mailx but instead of interpreting it as html it would send it out as text (html codes). Is there a way to send it as html?
(cat <<EOCAT
Subject: ...
3
votes
2answers
89 views
Distinguishing a regular file from a symlink
I'm writing a bash script that needs to distinguish a regular file from a symlink. I thought I could do this with if/test expression, but it doesn't work as I expected to:
$ touch regular_file
$ test ...
2
votes
2answers
59 views
How to group grep results?
I have a file that contains results grouped into categories. For example:
checking results for $var
here are some results1 for $var status ok
here are some results2 for $var status ok
here are some ...
3
votes
8answers
93 views
linux diff tools: create list of modified files
How do I create a list of modified files programmatically using linux command line tools? I'm not interested in the difference in any particular file (delta, patch). I just want to have a list of new ...
3
votes
3answers
76 views
Last failed command in bash
The $? variable holds the exit status of last run command. Is there a variable that holds last run command itself?
5
votes
4answers
127 views
Bash: test whether original script was run with `-x`
Is it possible to test whether a bash script was executed with -x?
I'm writing a script which also runs some remote scripts, and I'd like to be able to do something like:
USE_X="$( run_with_x ...
3
votes
2answers
32 views
Ignore escape characters when printing string in shell script
I just wrote a simple shell script to save a LaTeX expression as a PNG file. It works fine, except for the LaTeX-syntax for "next row", i.e. the double backslash \\.
When for instance my input ...
1
vote
2answers
40 views
perl regex replacing globally when global not selected
I'm using Ubuntu 11.04 and wrote a small script that searches within text files for certain "tokens" and replaces with some a prewritten snippet from a template file of the same name.
The text files ...