How should I specify path syntactically for sqlite3 in my .bashrc file? - sqlite

The SQLite folder containing sqlite3.exe is in C:\.
I am trying to add a path to my .bashrc that will allow me to use the sqlite3 command shell from C:\Users\User.
Again, structure is:
C:\Users\User (using Git bash here) and
C:\sqlite\
sqlite3.exe
sqldiff.exe
sqlite3.def
sqlite3.dll
sqlite3_analyzer.exe
I am attempting to use the sqlite3 command shell in Git bash on windows 8.1.
This is what is in my .bashrc file per Janos recommendation:
alias 'subl="C://Program Files/Sublime Text 3/sublime_text.exe"'
PATH=/c/sqlite/:$PATH
Is there possibly anything else missing?

Related

Run jq command in git-bash

jq command not found after adding jq executable
installing jq on git bash
My usecase is more similar with above shared references. I tried to execute a hook that needs to parse a json file. When hook gets executed it throws bash: jq:command not found error. So. I downloaded jq-win64.exe file and copied it to /usr/bin in Git folder. Then from git-bash I run export PATH=$PATH:"/C/Program Files/Git/usr/bin/jq-win64.exe" command and there is no error but when I checked jq --version command it still shows bash: jq:command not found error
Am I missing something? I even tried in windows cmd but is of no use. Hope someone can help me.
Thanks in advance!!!
PATH contains directories. That means what you should do:
Rename jq-win64.exe to jq.exe or just jq. (e.g. cp ~/Downloads/jq-win64.exe /usr/bin/jq).
You don't have to export your path, /usr/bin is already part of it.
If you didn't rename the file to jq (or jq.exe), then you would have to run it as jq-win64 in your console.
You could also put the binary into ~/bin folder, which should be part of PATH too. If it isn't, you can add it. Then you don't need to mess with your global binaries folder.

How to get the deb package located directory in preinst

I am creating a .deb package that would run a shell script as preinst.
The shell script needs some input files, which would be available at where I have the .deb package, as below.
Package_located_directory $ >
mydebpackage.deb
inputfile1
inputfile2
I would just transfer all the files to the different machine at any location and install it with dpkg -i mydebpackage.deb
I tried using pwd in the preinst to get the current deb file located directory.
So, I can get the path of the inputfiles from the preinst script.
But if I run pwd from preinst , it is giving me / instead of the package located directory.
Also I tried passing pwd from the PIPE to achieve this, as below,
pwd | dpkg -i mydebpackage.deb
But I do not want to depend on the user input for the path.
Please guide me for getting the current deb package located directory path from inside of preinst script.
it's better to use postinst and modify the file on your system.
for example : Modify the file /etc/test/test.txt in postinst file

Need help extracting data from a corrupt file

I have a file located at the following location on my computer:
D:\Pictures\Imported Catalogue\Ojulari-2
I want to be able to extract the data from the (corrupt file) database file into a text file with all the SQL commands needed to recreate the database.
I'm following instructions from the following link, but I seem to be stuck executing the right command line or should I say navigation the the location of the corrupt file using the command line provided (See below)
Link to instructions I am following: http://gerhardstrasse.wordpress.com/2010/08/19/recover-from-a-corrupt-adobe-lightroom-catalog-file/
Command line I am trying to execute:
echo .dump | ./sqlite3 ~/lightroom_catalog.lrcat > ~/lightroom_catalog.sql
Download the sqlite3 command-line shell, and put the .exe file in the same directory as the database.
Open a Windows command-line shell, and go to that directory:
D:
cd "\Pictures\Imported Catalogue\Ojulari-2"
Execute:
sqlite3 MyDatabaseFile .dump > MyDatabase.sql

Trying to set up sublime text 2 to open files in unix terminal but getting an error

I'm trying to set up sublime text 2 to open a file in my cygwin terminal by using the command 'subl [file]'. I run the below command in my terminal as instructed in a number of sites
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /bin/subl
However, I get this error:
ln: failed to create symbolic link `/bin/subl': File exists
How do I work around that?
Perhaps you could try using 'alias', instead?
Add a line to your .bashrc file similar to:
alias subl='/cygdrive/c/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl'
Then do a 'source .bashrc' command to load the new alias.
Try this on a Mac:
sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /bin/subl
You're on Windows, right? That directory you're trying to point to is the directory for the Mac OS install of Sublime Text 2. You'll probably want something more like this, though adjust the path to sublime_text.exe to match where yours is:
ln -s /cygdrive/c/Program\ Files/Sublime\ Text\ 2/sublime_text.exe /usr/local/bin/subl
Make sure /usr/local/bin is some directory in your PATH (echo $PATH to find out) so that your subl command will work from anywhere. Then you will be able to do subl . from any project directory to open that project in Sublime.

Unix: Getting Export PATH to "Stick"

When setting the export path in Unix, example:
export PATH=$PATH: $EC2_HOME/bin
If I quit terminal and open it back up to continue working, I have to go through all the steps again, setting up the paths each time.
I'm wondering how I can set the path and have it "stick" so my system knows where to find everything the next time I open terminal without having to do it all over again.
Thanks!
Open ~/.bashrc. This file is loaded every time you start up a new shell (if you're using Bash, which most people are). If you're using a different shell, the file may have a different name, like ~/.shrc.
Add the line you need to the bottom of the file:
export PATH=$PATH:$EC2_HOME/bi
Other info rolled up from elsewhere in the thread:
There are multiple places to put this, depending on your shell and your needs. All of these files are in your home directory:
For Bash:
.bashrc (executed when you shart a shell)
OR
.bash_profile (executed when you log in)
For csh and tcsh:
.cshrc
For sh and ksh:
.profile
Add it to your .cshrc file (for csh and tcsh), .profile file (for sh and ksh), or .bash_profile file (for bash)
You need to find your profile file and put that line in there. Suppose you use bash, the profile files are .bashrc and .bash_profile, found in ~. These files will vary depending on which shell you use.
You have to put those commands into one of the "autostart" files of your shell.
For bash this would be .bashrc in your homedirectory (create it if necessary)
add it to your .bashrc or another .bash startup file.
... and for ksh edit .profile.

Resources