mohamad_kian's profile (1548 points)
About: My name is Mohamad Hadi Kianersi
I Teaching Linux in sharif University of Iran
mohamad.hadi.kianersi@gmail.com
mohamad_hadi_kianersi@yahoo.com
how to fetch a string in the text.
I need a /media/New Volume type in this text
/dev/sda5 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
nfsd on /proc/fs/nfsd type nfsd (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/hamid/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=hamid)
/dev/sdc1 on /media/FreeAgent GoFlex Drive type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sde5 on /media/New Volume type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
the ' ' is importand
Asked in: ShellScripts
(4 answers)
mohamad_kian's response: you can use these command
tr - cut - grep - tail - head
| |
I have this line in my PHP script which removes dodgy characters from user input:
$var = str_replace(array(":", "'", ".", "!", "$", "", "/", "=", "+"), "", $var);
I'd like to add a backslash to that group of characters but adding "\", to the array breaks the script. I've tried "/", too.
Any ideas ? Thanks.
Asked in: OtherProgramming
(2 answers)
mohamad_kian's response: for "\"
you can use "\\"
| |
| | |