I have installed the composer and move the composer.phar file to /usr/local/bin just follow the following step: Then I edit my ~/.bash_profile file as following: and save the change and excute: But, when I excute the laravel new test command, it returns an error: PS: in /usr/local/bin directory have no larave…
Tag: bash
I create a file that is time stamped and for some reason I cant get newlines into the file
A few commands I tried are What can be going on? Is it because I use Notepad? Answer In short, yes. Notepad only understands DOS line-endings and not Unix line-endings. Use Wordpad or any other more capable editor to see the newlines correctly. Alternatively, if you do want to create DOS/Windows line-ending f…
Executing multiple commands under as another username within a file in BASH shell
I am attempting to execute a sqlplus command within a file. The file should be able to sudo switch into the oracle user and run the commands needed. The oracle user will need to first source a file with the parameters for the database, then be able to call a sql file from sqlplus. The script I have is Whether
ksh/bash run command line from variable
I set in cmd variable the find syntax: , I use ksh shell/bash so why when I want to run the cmd as the following I not actually activate the find … it’s also not works when I run with double brackets what is the resolution for this? Remark I not want to set the cmd like this ( this
Using awk command to go through a text file and incrementing counters for morning, afternoon, and night sections of the script
I am using awk to go through a text file that has information of finished scripts then says complete (morning) then informaton of finished scripts then says complete (afternoon) then information of finished scripts then says complete (night). I am trying to keep track of the finished scripts for each block. T…
Exec command in Ant only executes first command
I want to list the permission of every script in directory dir/bin. But the below command only runs “ls” in the directory where the script is with below code rather than every script in dir/bin. Since script.xml is there in maindir, it just does a ls inside maindir. There are 2 problems: Performin…
How to stop newline chars from escaping OLD gnu sed command
I am trying to replace a line in a file with multiple lines. When I had only one new line char ( ‘$’n ). it worked fine, however when I use two of them, it escapes my sed and the file wont run anymore. File.txt: DesiredOutput Actual Output Answer Using older BSD sed you can do: This should work wi…
Status after each argument passed to -exec in find
I’m writing a quick script to list all the files in a directory, run a function on each of them, and then print out the status code. Now the status code I would like is of the entire transaction and not the last expression that was executed. For example… Let’s say I have the following files …
Extract desired information from a string in Linux
Below is the string that I get, now I want to extract the two 3840 from this line, what command should I be using in Bash scripting? Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 3840×3840 [SAR 1:1 DAR 1:1], 100072 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc Answer You can pipe i…
Executing a script from a parent directory?
I have a root directory. In there I have ./bin/ In ./bin/ I have some bash scripts like: These scripts must be ran from ./bin, that is, the working directory must be: however, I would like to do: That last line would set the working directory temporarily to ./bin/ and would execute my script found in ./bin an…