What’s a .sh file?

What is a file with extension .sh? It is a Bourne shell script. They are used in many variations of UNIX-like operating systems. They have no “language” and are interpreted by your shell (interpreter of terminal commands) or if the first line is in the form #!/path/to/interpreter they will use that particular interpreter. Your file … Read more

How can I extract the first two characters of a string in shell scripting?

Probably the most efficient method, if you’re using the bash shell (and you appear to be, based on your comments), is to use the sub-string variant of parameter expansion: pax> long=”USCAGol.blah.blah.blah” pax> short=”${long:0:2}” ; echo “${short}” US This will set short to be the first two characters of long. If long is shorter than two … Read more

Remove redundant paths from $PATH variable

You just execute: export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games that would be for the current session, if you want to change permanently add it to any .bashrc, bash.bashrc, /etc/profile – whatever fits your system and user needs. Note: This is for Linux. We’ll make this clear for new coders. (` , ‘) Don’t try to SET = these.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)