Tag Info

Hot answers tagged

10

Since you need a setuid sandbox to run breach you basically have two options: Use the one provided by chromium-brower (recommended method): sudo apt-get install chromium-browser Go to the breach folder (e.g breach-v0.3.20-alpha.5-linux-x64) and type the following command: CHROME_DEVEL_SANDBOX=/usr/lib/chromium-browser/chrome-sandbox ./breach Follow ...


8

As simple as possible: xargs whatis < cmdlist.txt > cmdinfo.txt


6

Much simpler one, $ while read -r line; do whatis "$line"; done < cmdlist.txt > cmdinfo.txt cut (1) - remove sections from each line of files lshw (1) - list hardware top (1) - display Linux processes awk (1) - pattern scanning and text processing language sensors (1) - print sensors ...


5

You have to use a command substitution: #Generate random password PASSWORD=$(date +%s|sha256sum|base64|head -c 32) echo $PASSWORD then it should work. Prefer the "$" sign, read more here: Using backticks or dollar in shell scripts


5

If your script runs as "yourUser", you could create a simple file: sudo visudo -f /etc/sudoers.d/myOverrides with this directive: yourUser ALL = NOPASSWD:/usr/bin/apt-get You can find an useful explanation here.


4

You need to use a command substitution quotation, like PASSWORD=`date +%s|sha256sum|base64|head -c 32` echo $PASSWORD or you can do it as, PASSWORD=$(date +%s|sha256sum|base64|head -c 32) echo $PASSWORD


4

Executing a script cannot affect the shell that called it, since the script runs in its own shell. To affect the calling shell, you need to source the script: $ help source source: source filename [arguments] Execute commands from a file in the current shell. Read and execute commands from FILENAME in the current shell. The entries in ...


4

I've demonstrated the problem here: $ pie() { echo $1; }; pie '*' 1 2 3 4 5 file Expanded. Bother. But the solution is quite simple. You just need to quote it but in a way that bash will understand. We use double-quotes. It will be replaced with the variable contents but it won't be expanded. $ pie() { echo "$1"; }; pie '*' *


3

udpate and udgrade is wrong! try this : #!/bin/bash echo "Updating system..." sudo apt-get update sudo apt-get upgrade


3

Add sleep 600; to the beginning of your crontab command to make it wait for 600 seconds before proceeding to the next step. Your new crontab command would look like @reboot sleep 600; find ${HOME}/my_app/check_conn.rb


3

The right syntax is python script1.py & python script2.py & python script3.py & My reference is man bash in the Lists section: Lists A list is a sequence of one or more pipelines separated by one of the operators ;, &, &&, or ||, and optionally terminated by one of ;, &, or <newline>. [...] If a command is ...


3

Well the syntax of the command can help you bwa samse [-n max_occ] [-f out.sam] [-r RG_line] <prefix> <in.sai> <in.fq> Now let's look at your bash: for j in {004,005}; do for i in {001..004}; do bwa samse -f $j_$i.sam $hg19 $j_$i.sai $j_$i.fastq # Do the other conversions from $j_$i.sam samtools view -bS ...


3

Very simply: for i in $(cat cmdlist.txt); do whatis $i ; done > cmdinfo.txt This loops through every entry (i) in the output of $(cat cmdlist.txt), and runs a whatis on very entry. Example output: cut (1) - remove sections from each line of files lshw (1) - list hardware top (1) - display Linux processes awk (1) ...


2

Something like this: #! /bin/bash in_file=$1 out_file=$2 while read command do whatis $command done < $in_file >> $out_file I have chosen to leave stderr untouched, since if you have a command in there for which whatis information is not available, you should be made aware of that (and look elsewhere, if needed).


2

I think that you can get properly result with following command. $ for i in `cat cmdlist.txt`;do whatis $i 2>&1;done | sed "s,: nothing appropriate.,,g" > cmdinfo.txt In fact, $ for i in `cat cmdlist.txt`;do whatis $i 2>&1;done The command, first command's one part will show outputs as following . cut (1) - remove ...


2

Generating a password just based on the current time is quite bad. As you want a 32-character password, I would do something like this: PASSWORD=$(head -c 16 /dev/random | md5sum | cut -f 1 -d\ )


2

If you have google chrome installed, do export CHROME_DEVEL_SANDBOX=/opt/google/chrome/chrome-sandbox just before you run breach with ./breach Essentially, this is a shortcut to running build/update-linux-sandbox.sh mentioned there.


2

When you run a bash script, all of it's commands run in the directory where the script is invoked from, including pwd. For example: #!/bin/bash pwd If you run this from /whatever/path, it will display /whatever/path, no matter where the script is placed. If you want to operate on files in the directory where you are running the script from, you can omit ...


2

By default, awk strips leading and trailing spaces and assigns each non-whitespace token to a field (if you do not change the field separator). This can be done in Python with: import sys f = sys.stdin # If you need to open a file instead: #f = open('your.file') for line in f: fields = line.strip().split() # Array indices start at 0 unlike AWK ...


2

Use the following: java -jar /home/$USER/VISDashboard2014/VISDashboard.jar


2

You probably remove the file named by $Filetmp too soon. The rm command is inside the inner loop: rm -f $Filetmp done done Due to this, the file is removed after the first iteration through the inner loop (i.e. when $i = 0). Subsequent iterations ($i > 0) will not find the file. No error is reported because you call grep with option -s, but ...


2

That is quite simple. Write a script something like this: #!/bin/bash xterm -e /bin/bash /path/to/script_1.sh & xterm -e /bin/bash /path/to/script_2.sh & The -e option means "execute". The argument after it is the command to execute (here it is /bin/bash) and the next option is the argument for the command (here the name of the script-file). & ...


2

You need to familiarize yourself with the basic rules concerning shell expansion of variables. NAME="start" IF you present $NAME to the shell it will be exanded to the string start If you put single quotes around a string, the shell does not expand whatever is within the single quotes, so '$NAME' stays as $NAME Now with double quotes, the shell expands ...


1

You have to use {print$n} to print the nth word. So in your case it would be {print$3} The Final command becomes, awk -v word=two '$0 ~ "[^[:alpha:]]" word "[^[:alpha:]]" {print$3}' which will give output three four


1

You were super close! #!/bin/bash chmod +x D3GO


1

You can make terminator to execute a command with -x COMMAND [option]. So to run terminator with executing a shell script you can do the following: terminator -x bash /path/to/script.sh This will start a new instance of terminator and will automatically start the script in the bash and ask you for a password if necessary (e.g. when using a command with ...


1

Try this instead: :!./% I use bash, so my error codes are different, but the path gets a bit of when you run % directly. Also, you might need to run :!chmod u+x ./% before to make the script executable.


1

That will only work if the script file's permissions have the executable bit set. You can do this through Vim :! chmod +x % :! ./% Or you could just run it through its interpreter manually: :! bash %


1

java -jar /home/$(logname)/VISDashboard2014/VISDashboard.jar should work.


1

You can use following conmand: In which $USER is environment variable which gives username java -jar /home/$USER/VISDashboard2014/VISDashboard.jar



Only top voted, non community-wiki answers of a minimum length are eligible