Problems with buildbot shell command : Adding single quotes to last argc argument - buildbot

I am running buildbot v0.8.9 and encountering a really weird problem.
I try to change the access permissions of exe files and runs into troubles.
Here is the code I first wrote :
ShellCommand(command=["chmod", "u+rwx , "*.exe"],workdir="myWorkDir",descriptionDone=["Changing permission access"])
This result in :
chmod u+rwx '*.exe'
After I read that article which seemed to be what I wanted, but after following it and doing :
ShellCommand(command=["sh", "chmod u+rwx *.exe"],workdir="myWorkDir",descriptionDone=["Changing permission access"])
I got this :
sh 'chmod u+rwx *.exe'
So the problem of the last argument single quoted is still there.

I finally found the response, reading the article I linked again since I had to do something else kind of related to that issue :
I wanted to use the "-c" argument, and I was missing it on my 2nd attempt.
So here is the correct code :
ShellCommand(command=["sh", "-c", "chmod u+rwx *.exe"],workdir="myWorkDir",descriptionDone=["Changing permission access"])

Related

How to undo a sed cli .zsh

I am on Ubuntu 18.04.1 LTS
As I use very often "clear" in my zsh terminal, I wanted to delete it from my .zshrc_history file.
I found this command line : sed -i '/string/d' .bash_history here ZSH / BASH : Delete specific lines from history.
I know there is no up vote for it, but I did it with my own configuration :
sed -i '/clear/d' .zsh_history (clear as the word I wanted to delete)
But now when I type history in my zsh shell, I have only a few lines shown. I think the lines before hitting the first clear and not all my history.
As I write in the zsh, it now keeps only theses few lines and not incrementing the lines (so the first history line is hidden to show the new one and I always have only 16 lines in my history).
When I open my .zshrc_history file, I have all my history shown as this :
1 : 1543529720:0;sudo apt-get install zsh-syntax-highlighting
... etc.
1556 : 1549402753:0;ls
1557 : 1549403085:0;code .zsh_history
1558 : 1549403818:0;source .zshrc
1559 : 1549405008:0;npm -v
Is there a way to undo this command and have all my history back shown in my shell ?
Thanks for your help.
If you speaks french it is even better for my understanding
UPDATE
Hi #jhnc that's right my .zshrc_history has everything from line 1.
I already backup this .zshrc_history file, thanks to mention it.
So I did echo $HISTSIZE $SAVEHIST $HISTFILE and here is the result :
50000 10000 /home/echayotte/.zsh_history
I started with bash before using zsh this is why I put them both :
in .zshrc_history
Line 1 shows :
: 1543529608:0;sudo apt-get install powerline fonts-powerline
in .bash_history
Line 1 shows :
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
In my folder I have this icons and before that they were the same as the bash history
icons of .zsh/bash_history
UPDATE
So I create a new .zsh_history file but the problem is unsolved.
I don't know what to do ...
Do I need to reinstall zsh; This will fix my problem ?

Perforce p4 sync command fails for a folder which has a space in it's name

There is a folder with the name Test Logs. As it can be seen there is a space between Test and Logs
When I try to get it locally using sync command in perl script it fails.
The script has the code:
system("p4 sync -f //depot/Test Logs/OnTargetLogs/...");
I get the following error:
> //depot/Test - no such file(s).
> Logs/OnTargetLogs/... - no such file(s).
Quote the argument maybe?
system("p4 sync -f \"//depot/Test Logs/OnTargetLogs/...\"");
– Sobrique
What you said worked. Also I found another way of doing this :
my #a1 = ("p4","sync","-f","//depot/Test Logs/OnTargetLogs/..."); system #a1;
– Vishal Khemani

Logging a PostgreSQL session in text file

I am trying to log a complete session in psql into a .txt file. The command given to me was initially this:
psql db_name| tee file_name.txt
However, my SSH client does nothing until I quit it. That means, it does not recognize any command. More like a document, no action happens no matter what I write. So far, only '\q' is recognised which lets me get out of it. Any ideas what is happening? How am I to write the query if shell will not read anything. Also, I tried the following (this is before connecting to database) :
script filename.txt
It does show the message : script started, file is filename.txt, but I dont know where this file is stored and how to retrieve it.
Any help with the above will be welcome and really appreciated! Thanks a lot :)
There is option to psql for log query and results:
-L filename
--log-file filename
Write all query output into file filename, in addition to the normal output destination.
Try this:
psql db_name -L file_name.txt

iPhone .bashrc not working properly

SOLVED: I had the wrong line endings selected in my text editor
I tried to get a .bashrc going on my iPhone, just for fun. After adding source /var/root/.bashrc to my /etc/profile file I get this every time I log into a terminal emulator, local or over SSH.
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
: command not found
>
My cursor overwrites the '>' everytime I type
The contents of /var/root/.bashrc
alias install='apt-get install'
alias remove='apt-get remove'
alias aptsearch='apt-cache search'
alias respring='killall SpringBoard'
alias safemode='touch /var/mobile/Library/Preferences/com.saurik.mobilesubstrate.dat && killall SpringBoard'
alias shutdown='halt'
alias poweroff='halt'
alias ls='ls -group-directories-first -Ah'
alias lsl='ls -Ah1 --group-directories-first'
alias killall='killall -v'
alias reload='source /var/root/.bashrc'
export PS1='\w> '
clear
The contents of /etc/profile
export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games'
export PS1='\h:\w \u\$ '
umask 022
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done
source /var/root/.bashrc
Any and all help is appreciated.
SOLVED: I had the wrong line endings selected in my text editor
Try manually executing the script and taking a look at the output. You should get a line number to help you along.

export PATH creating a redundant path

I need to add some perl scripts to PATH, but when I do, and try to run the scripts, it can't find the files. For some reason it is using a redundant path and doesn't find it. I dont know how to describe the problem but the code is pretty self-explanatory.
[lsk250#murphy portfolio-handout]$ pwd
/home/lsk250/portfolio-handout
[lsk250#murphy portfolio-handout]$ export PATH=$PATH:/home/lsk250/portfolio-handout/
[lsk250#murphy portfolio-handout]$ time_series_symbol_project.pl
env: /home/lsk250/portfolio-handout//home/lsk250/portfolio-handout/get_data.pl: No such file or directory
sh: line 1: 17758 Aborted (core dumped) time_series_project _data.in 8 AWAIT 300 ARIMA 2 1 2 2> /dev/null
Any ideas whats the right export command I should use to get this right?
There is nothing wrong in how you export PATH variable except that you may already have your "pwd" there.
As far as I can see the get_data.pl is called from time_series_symbol_project.pl (or from some other script called from time_series_symbol_project.pl and so on) and I would check how it is called.
Perhaps you could also see if PATH is changed somewhere in your scripts.
i'm guessing the "shebang" line (#!) and/or file permissions on 'get_data.pl' is incorrect.